This lens animates 4 emotions: Happy 😁, Sad 😢, Angry 😠💢, and PARTY 🕺💃.
| Happy 😁 | Sad 😢 |
|---|---|
![]() |
![]() |
| Angry 😠💢 | Party 🕺💃 |
![]() |
![]() |
Link: https://jonathancng.github.io/Emotion-Lens/
Warning: The machine learning is trained on a small set of data—me & myself. If you'd like to train the machine learning algorithm to your face, follow Debugging steps below!
Instructions:
- Happy: Wide Smile
- Sad: Pout with raised eyebrows, head tilted back.
- Angry: Scrunch eyebrows, mean teeth, head tilted forward.
- Party: Raise both arms!
- Install extension (https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
- Go to index.html
- Right-click blank space and select Open With Live Server
Ready to be a professional developer? Well there's no need to be if you just follow my instructions!
- Download & Install VS Code (https://code.visualstudio.com/download).
- Clone this repository (Either your own way, or with Github Desktop (https://desktop.github.com/)).
- Open the repository with VS Code.
- Install the Live Server extension to VS Code (https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer).
- Go to Google's Teachable Machine (https://teachablemachine.withgoogle.com/train/image).
- Create classes: "Nothing", "Happy", "Sad", "Angry".
- Use "Webcam" to give corresponding data.
- Click "Train Model".
- Click "Export" > "Upload my model"
- Copy Shareable Link URL.
- Replace URL in Line 55 of emotion_lens.js with the copied link.
- Go to
index.html. - Right-click blank space and select "Open With Live Server".
- You did it! 🎉 Now, have fun!!
- p5.js (https://p5js.org/)
- ml5.js (https://ml5js.org/)
- Teachable Machine (https://teachablemachine.withgoogle.com/)




