Skip to content

Add face-metrics to Vision Detection - #1223

Closed
Robin2027 wants to merge 1 commit into
sorrycc:masterfrom
Robin2027:add-face-metrics
Closed

Robin2027 wants to merge 1 commit into
sorrycc:masterfrom
Robin2027:add-face-metrics

Conversation

@Robin2027

Copy link
Copy Markdown

Adds face-metrics to Vision Detection — one line, following the [PACKAGE](LINK) - DESCRIPTION. format from CONTRIBUTING.md.

What it is — a zero-dependency ES module that runs in the browser and in Node. You feed it face landmarks (MediaPipe Face Mesh 468/478, dlib/iBUG 68) and it returns a mirror-symmetry index — the facial midline is fitted by least squares to the landmark pairs, so head tilt in the photo does not read as asymmetry — plus anthropometric ratios such as interocular/bizygomatic width, bigonial/bizygomatic width and the morphological facial index. Every number is returned together with the formula and the landmark indices that produced it.

Being straight about the category — this is the measurement step after detection, not a detector itself. The section currently holds two browser vision libraries (tracking.js, ocrad.js); this is the geometry layer that runs on top of whatever landmark model you already have. If you would rather keep this section to detectors, say so and I will close it rather than argue for a different slot.

It runs

  • npm test — 20 tests, no test framework, green on Node 18/20/22 via GitHub Actions.
  • Browser demo: https://robin2027.github.io/face-metrics/examples/browser/ — pick a photo, MediaPipe runs locally in WebAssembly, the landmarks and the fitted midline are drawn and the table is printed. The image never leaves the tab.
  • CLI: node bin/face-metrics.mjs landmarks.json.

Licence — MIT, no dependencies, no network calls, no paid tier.

Disclosure — I am the author.

@gokaygurcan

Copy link
Copy Markdown
Collaborator

you are the winner. 5 minutes after creation. i dont think anyone can beat it for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants