Skip to main content

Facial expression

Emotion Detector for Photos and Webcam

Updated 3 min read

The Emotion analysis scores each face in a photo, or live on your webcam, against seven expressions: neutral, happy, sad, angry, surprised, fearful and disgusted. You see the strongest expression and how the scores split across the rest, so a mostly neutral face with a hint of a smile reads differently from a broad grin.

It reads expressions, not feelings: a polite smile and a happy one can look the same to a camera. Everything runs in your browser through face-api.js on TensorFlow.js. The photo is never uploaded, and recent scans keep only the numbers, never the image.

Want every option? Open the Emotion analysis

How to use it

  1. 1

    Choose a photo with the face clearly visible, or switch to the webcam to see the expression scores update in real time.

  2. 2

    Read the dominant expression for each face, then the bar for each of the 7 expressions to see how mixed the reading was.

  3. 3

    Change your expression on camera, or try a second photo, to see which features move the happy, surprised and neutral scores most.

What the emotion detector measures

After finding a face, the tool passes it to a small expression network from face-api.js. The network was trained on photos labelled with seven basic expressions, and for each face it returns a score for every one of them. The scores add up to the whole, so you can see whether a face is clearly one expression or a blend of two or three.

The features that drive those scores are the visible ones: how far the mouth corners lift or drop, whether the lips part, how wide the eyes open, whether the brows rise, lower or pinch together, and whether the nose wrinkles. That is why a smile with the eyes narrowed scores differently from a smile with wide eyes, and why a raised-brow look can tip towards surprised.

Expression is not emotion

This is the most important limit to understand. A face shows an expression; a person feels an emotion. People smile when they are nervous, look neutral when they are delighted, and frown when they are concentrating. Cultural norms also shape how and when people show expressions. The detector can tell you what a face looks like in one frame. It cannot tell you what anyone is feeling, and it should never be used to judge mood, honesty, attention or intent.

Getting a clean reading

Neutral is the most common result on everyday photos, because most faces at rest are close to it. If you are testing the detector, exaggerated expressions show the clearest differences between the seven scores.

  • Face the camera; side views hide half the mouth and one eye.
  • Use even light so the brow and mouth corners are visible.
  • Keep hands, hair and masks away from the mouth and eyes.
  • On webcam, hold an expression for a moment so the scores settle.
  • Small faces in group photos give rougher scores; crop closer if you can.

Fair uses

Practising expressions for acting or presentations, checking which of several photos looks friendliest, teaching how expression classifiers work and seeing where they fail are all good uses. Monitoring people, scoring job candidates or students, or making decisions about anyone from their expression are not, and in several jurisdictions emotion recognition in workplaces and schools is restricted by law.

Frequently asked questions

Which emotions does it detect?

Seven expressions: neutral, happy, sad, angry, surprised, fearful and disgusted. Each face gets a score for all seven, and the highest is shown as the dominant expression.

Does it work live on a webcam?

Yes. Switch to the camera view and the scores update as your expression changes. Frames are processed in your browser and are not recorded or uploaded.

Why does it keep saying neutral?

Most relaxed faces are close to neutral, and subtle expressions move the other scores only a little. Check the bars rather than the label; a few points of happy on a neutral face is a faint smile.

Can it tell if someone is lying or upset?

No. It reads the visible expression in a frame, not feelings or intent. People often show expressions that do not match how they feel.

Does it work on group photos?

Yes. Each detected face gets its own set of expression scores.

Is my photo or video stored?

No. Everything runs on your device and nothing is uploaded.

Run a website? Link to this guide if it helps your readers, and see our free backlink sites list for places to get your own site listed.