You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

constants.ts 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. export const FACE_EXPRESSIONS_EMOJIS = {
  2. happy: '😊',
  3. neutral: '😐',
  4. sad: '🙁',
  5. surprised: '😮',
  6. angry: '😠',
  7. fearful: '😨'
  8. // disgusted: '🤢'
  9. };
  10. export const FACE_EXPRESSIONS = [ 'happy', 'neutral', 'sad', 'surprised', 'angry', 'fearful' ];
  11. export const FACE_EXPRESSIONS_NAMING_MAPPING = {
  12. happy: 'happy',
  13. neutral: 'neutral',
  14. surprise: 'surprised',
  15. angry: 'angry',
  16. fear: 'fearful',
  17. disgust: 'disgusted',
  18. sad: 'sad'
  19. };
  20. /**
  21. * Time is ms used for sending expression.
  22. */
  23. export const WEBHOOK_SEND_TIME_INTERVAL = 15000;
  24. /**
  25. * Type of message sent from main thread to worker that contains init information:
  26. * such as models directory and window screen size.
  27. */
  28. export const INIT_WORKER = 'INIT_WORKER';
  29. /**
  30. * Type of event sent on the data channel.
  31. */
  32. export const FACE_BOX_EVENT_TYPE = 'face-box';
  33. /**
  34. * Miliseconds interval value for sending new image data to the worker.
  35. */
  36. export const SEND_IMAGE_INTERVAL_MS = 1000;
  37. /**
  38. * Type of message sent from main thread to worker that contain image data and
  39. * will trigger a response message from the worker containing the detected face(s) info.
  40. */
  41. export const DETECT_FACE = 'DETECT_FACE';
  42. /**
  43. * Available detection types.
  44. */
  45. export const DETECTION_TYPES = {
  46. FACE_BOX: 'face-box',
  47. FACE_EXPRESSIONS: 'face-expressions'
  48. };