Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <body>
  2. ...
  3. <script src="https://ai-sdk.morphcast.com/v1.8.3/ai-sdk.js"></script>
  4. <script>
  5.  
  6. camera = {
  7. getFrames(){
  8. return new Promise(function(){
  9. resolve(frame);
  10. });
  11.  
  12. }
  13.  
  14. CY.loader()
  15. .addModule(CY.modules().FACE_AGE.name)
  16. .addModule(CY.modules().FACE_GENDER.name)
  17. .load()
  18. .then(({ start, stop }) => start());
  19.  
  20.  
  21. window.addEventListener('CY_AGE_RESULT',function(data){
  22. // ..; ..
  23. send(data.detail.output.numericAge);
  24. });
  25.  
  26. window.addEventListener('CY_GENDER_RESULT',function(data){
  27. /*
  28. here communicate with native app to forward gender data;
  29. */
  30. send(data.detail.output.gender);
  31. });
  32.  
  33.  
  34. </script>
  35. ...
  36. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement