Giter VIP home page Giter VIP logo

7688-face-cognition's Introduction

Application With Microsoft Cognitive Service

This project is for connecting web cam and Microsoft cognitive service through Linkit 7688,meanwhile, display the detected face information on the webpage

Requirements

  • Linkit smart 7688
  • webcam

Code review

cognitive.js

  • open the webcam
  • make snapshot periodically and output a jpg file
  • read the jpg file and post to cognitive api
  • recieve the response
  • use socket.io to send data to index.html
  • html canvas draw the text and frame

Usage

Login 7688 and type the following commands in the console.

Download the code and change the working directory to it.

curl -L https://github.com/YuanYuYuan/7688-face-cognition/raw/master/face-cognition.tar.gz | tar zxv
cd face-cognition

Then use sed command to change the linkit_7688_ip to which ip your 7688 is using. For example, my pc and 7688 are in the same local network, and my 7688 ip is 192.168.0.102.

sed -i 's/linkit_7688_ip/192.168.0.102/g' face-cognition.js static/index.html

Go to Microsoft Cognitive Service website and regist a new account if you don't have one. https://www.microsoft.com/cognitive-services

And go to Face API and have your new face api key.

Press copy button in Keys column and paste it in the sed command. For examle, my api key is a05f5738bdd7449b85ced1075129137b.

sed -i 's/my-face-api-key/a05f5738bdd7449b85ced1075129137b/g' face-cognition.js

Also, have one emotion api key.

Press copy button in Keys emotion api column and paste it in the sed command. For examle, my api key is 512a3e8d759c45d2898a072e62a1b018.

sed -i 's/my-emotion-api-key/512a3e8d759c45d2898a072e62a1b018/g' face-cognition.js

Finally, connect your webcam with OTG cable to 7688 and run the cognition.js!

node face-cognition.js

Demo

7688-face-cognition's People

Contributors

yuanyuyuan avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.