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.js 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // @flow
  2. export const FACIAL_EXPRESSION_EMOJIS = {
  3. happy: '😊',
  4. neutral: '😐',
  5. sad: '🙁',
  6. surprised: '😮',
  7. angry: '😠',
  8. fearful: '😨'
  9. // disgusted: '🤢'
  10. };
  11. export const FACIAL_EXPRESSIONS = [ 'happy', 'neutral', 'sad', 'surprised', 'angry', 'fearful' ];
  12. /**
  13. * Time used for detection interval when facial expressions worker uses webgl backend.
  14. */
  15. export const WEBGL_TIME_INTERVAL = 1000;
  16. /**
  17. * Time used for detection interval when facial expression worker uses cpu backend.
  18. */
  19. export const CPU_TIME_INTERVAL = 6000;
  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 message sent from main thread to worker that contain image data and
  31. * will set a timeout for sending back the expression if detected in the worker.
  32. */
  33. export const SET_TIMEOUT = 'SET_TIMEOUT';
  34. /**
  35. * Type of message sent from main thread to worker that will stop the recognition;
  36. * the worker will clear the timeout and then will send nothing back.
  37. */
  38. export const CLEAR_TIMEOUT = 'CLEAR_TIMEOUT';
  39. /**
  40. * Type of message sent from the worker to main thread that contains a facial expression or undefined.
  41. */
  42. export const FACIAL_EXPRESSION_MESSAGE = 'FACIAL_EXPRESSION_MESSAGE_TYPE';
  43. /**
  44. * Type of message sent from the worker to main thread that contains the time interval chosen by the worker.
  45. */
  46. export const INTERVAL_MESSAGE = 'INTERVAL_MESSAGE_TYPE';