{"_id":"@tensorflow-models/facemesh","_rev":"2997128","name":"@tensorflow-models/facemesh","description":"Pretrained facemesh model","dist-tags":{"latest":"0.0.5"},"maintainers":[{"name":"annxingyuan","email":""},{"name":"caisq","email":""},{"name":"dedongala","email":""},{"name":"fengwuyao","email":""},{"name":"jinjingforever","email":""},{"name":"linazhao128","email":""},{"name":"linchan","email":""},{"name":"mattsoulanille","email":""},{"name":"pyu10055","email":""}],"time":{"modified":"2023-08-29T08:35:09.000Z","created":"2020-03-07T14:06:41.133Z","0.0.5":"2020-10-12T12:52:09.024Z","0.0.4":"2020-08-11T11:18:56.081Z","0.0.3":"2020-05-20T19:14:37.513Z","0.0.2":"2020-05-20T19:02:31.894Z","0.0.1":"2020-03-07T14:06:41.133Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/tensorflow/tfjs-models.git"},"versions":{"0.0.5":{"name":"@tensorflow-models/facemesh","version":"0.0.5","description":"Pretrained facemesh model","main":"dist/index.js","jsnext:main":"dist/facemesh.esm.js","module":"dist/facemesh.esm.js","unpkg":"dist/facemesh.min.js","jsdelivr":"dist/facemesh.min.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/tensorflow/tfjs-models.git"},"peerDependencies":{"@tensorflow/tfjs-converter":"^2.1.0","@tensorflow/tfjs-core":"^2.1.0"},"dependencies":{"@tensorflow-models/blazeface":"0.0.5","rimraf":"^3.0.2"},"devDependencies":{"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-converter":"^2.1.0","@tensorflow/tfjs-core":"^2.1.0","@tensorflow/tfjs-backend-cpu":"^2.1.0","@types/jasmine":"~2.8.8","babel-core":"~6.26.0","babel-plugin-transform-runtime":"~6.23.0","jasmine-core":"~3.5.0","rollup":"~2.3.2","rollup-plugin-terser":"~5.3.0","rollup-plugin-visualizer":"~3.3.2","ts-node":"~8.8.2","tslint":"~5.18.0","typescript":"~3.5.3","yalc":"~1.0.0-pre.21"},"scripts":{"build":"rimraf dist && tsc","publish-local":"yarn build && rollup -c && yalc publish","test":"ts-node --skip-ignore --project tsconfig.test.json run_tests.ts","build-npm":"yarn build && rollup -c","lint":"tslint -p . -t verbose","publish-demo":"./scripts/publish-demo.sh"},"license":"Apache-2.0","bugs":{"url":"https://github.com/tensorflow/tfjs-models/issues"},"homepage":"https://github.com/tensorflow/tfjs-models#readme","_id":"@tensorflow-models/facemesh@0.0.5","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"shasum":"de8fba2c0fe28e08fea1951e080653e1b2fda8ae","size":10341292,"noattachment":false,"key":"/@tensorflow-models/facemesh/-/@tensorflow-models/facemesh-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/@tensorflow-models/facemesh/download/@tensorflow-models/facemesh-0.0.5.tgz"},"maintainers":[{"name":"annxingyuan","email":""},{"name":"caisq","email":""},{"name":"dedongala","email":""},{"name":"fengwuyao","email":""},{"name":"jinjingforever","email":""},{"name":"linazhao128","email":""},{"name":"linchan","email":""},{"name":"mattsoulanille","email":""},{"name":"pyu10055","email":""}],"_npmUser":{"name":"annxingyuan","email":"annyuan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facemesh_0.0.5_1602507128646_0.6534274509393547"},"_hasShrinkwrap":false,"publish_time":1602507129024,"deprecated":"This package has been archived in favor of @tensorflow-models/face-landmarks-detection and will no longer be updated. Please refer to @tensorflow-models/face-landmarks-detection for future updates.","_cnpm_publish_time":1602507129024,"_cnpmcore_publish_time":"2021-12-17T05:26:02.850Z"},"0.0.4":{"name":"@tensorflow-models/facemesh","version":"0.0.4","description":"Pretrained facemesh model","main":"dist/index.js","jsnext:main":"dist/facemesh.esm.js","module":"dist/facemesh.esm.js","unpkg":"dist/facemesh.min.js","jsdelivr":"dist/facemesh.min.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/tensorflow/tfjs-models.git"},"peerDependencies":{"@tensorflow/tfjs-converter":"^2.1.0","@tensorflow/tfjs-core":"^2.1.0"},"dependencies":{"@tensorflow-models/blazeface":"0.0.5","rimraf":"^3.0.2"},"devDependencies":{"@rollup/plugin-commonjs":"^11.0.2","@rollup/plugin-node-resolve":"^7.1.1","@rollup/plugin-typescript":"^3.0.0","@tensorflow/tfjs-converter":"^2.1.0","@tensorflow/tfjs-core":"^2.1.0","@tensorflow/tfjs-backend-cpu":"^2.1.0","@types/jasmine":"~2.8.8","babel-core":"~6.26.0","babel-plugin-transform-runtime":"~6.23.0","jasmine-core":"~3.5.0","rollup":"~2.3.2","rollup-plugin-terser":"~5.3.0","rollup-plugin-visualizer":"~3.3.2","ts-node":"~8.8.2","tslint":"~5.18.0","typescript":"~3.5.3","yalc":"~1.0.0-pre.21"},"scripts":{"build":"rimraf dist && tsc","publish-local":"yarn build && rollup -c && yalc publish","test":"yarn build && ts-node --skip-ignore run_tests.ts","build-npm":"yarn build && rollup -c","lint":"tslint -p . -t verbose","publish-demo":"./scripts/publish-demo.sh"},"license":"Apache-2.0","bugs":{"url":"https://github.com/tensorflow/tfjs-models/issues"},"homepage":"https://github.com/tensorflow/tfjs-models#readme","_id":"@tensorflow-models/facemesh@0.0.4","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"4748a8e48e677107d4b174efb06d09452de09cf5","size":10339184,"noattachment":false,"key":"/@tensorflow-models/facemesh/-/@tensorflow-models/facemesh-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/@tensorflow-models/facemesh/download/@tensorflow-models/facemesh-0.0.4.tgz"},"maintainers":[{"name":"annxingyuan","email":""},{"name":"caisq","email":""},{"name":"dedongala","email":""},{"name":"fengwuyao","email":""},{"name":"jinjingforever","email":""},{"name":"linazhao128","email":""},{"name":"linchan","email":""},{"name":"mattsoulanille","email":""},{"name":"pyu10055","email":""}],"_npmUser":{"name":"annxingyuan","email":"annyuan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facemesh_0.0.4_1597144735641_0.6088049484426867"},"_hasShrinkwrap":false,"publish_time":1597144736081,"_cnpm_publish_time":1597144736081,"_cnpmcore_publish_time":"2021-12-17T05:26:20.077Z"},"0.0.3":{"name":"@tensorflow-models/facemesh","version":"0.0.3","description":"Pretrained facemesh model","main":"dist/index.js","jsnext:main":"dist/facemesh.esm.js","module":"dist/facemesh.esm.js","unpkg":"dist/facemesh.min.js","jsdelivr":"dist/facemesh.min.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/tensorflow/tfjs-models.git"},"peerDependencies":{"@tensorflow/tfjs-converter":"^1.6.1","@tensorflow/tfjs-core":"^1.6.1"},"dependencies":{"@tensorflow-models/blazeface":"0.0.5"},"devDependencies":{"@tensorflow/tfjs-converter":"^1.6.1","@tensorflow/tfjs-core":"^1.6.1","@types/jasmine":"~2.5.53","jasmine":"~3.2.0","jasmine-core":"~3.1.0","rimraf":"~2.6.2","rollup":"~0.58.2","rollup-plugin-node-resolve":"~3.3.0","rollup-plugin-typescript2":"~0.13.0","rollup-plugin-uglify":"~3.0.0","ts-node":"~5.0.0","tslint":"~5.8.0","typescript":"3.3.3333","yalc":"^1.0.0-pre.27"},"scripts":{"build":"rimraf dist && tsc","publish-local":"yarn build && rollup -c && yalc publish","test":"ts-node run_tests.ts","build-npm":"yarn build && rollup -c","lint":"tslint -p . -t verbose","publish-demo":"./scripts/publish-demo.sh"},"license":"Apache-2.0","bugs":{"url":"https://github.com/tensorflow/tfjs-models/issues"},"homepage":"https://github.com/tensorflow/tfjs-models#readme","_id":"@tensorflow-models/facemesh@0.0.3","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"da93d94e61e01b5088ade200f4ed6942d4499da5","size":10324574,"noattachment":false,"key":"/@tensorflow-models/facemesh/-/@tensorflow-models/facemesh-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@tensorflow-models/facemesh/download/@tensorflow-models/facemesh-0.0.3.tgz"},"maintainers":[{"name":"annxingyuan","email":""},{"name":"caisq","email":""},{"name":"dedongala","email":""},{"name":"fengwuyao","email":""},{"name":"jinjingforever","email":""},{"name":"linazhao128","email":""},{"name":"linchan","email":""},{"name":"mattsoulanille","email":""},{"name":"pyu10055","email":""}],"_npmUser":{"name":"annxingyuan","email":"annyuan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facemesh_0.0.3_1590002076711_0.6980358186357081"},"_hasShrinkwrap":false,"publish_time":1590002077513,"_cnpm_publish_time":1590002077513,"_cnpmcore_publish_time":"2021-12-17T05:26:34.650Z"},"0.0.2":{"name":"@tensorflow-models/facemesh","version":"0.0.2","description":"Pretrained facemesh model","main":"dist/index.js","jsnext:main":"dist/facemesh.esm.js","module":"dist/facemesh.esm.js","unpkg":"dist/facemesh.min.js","jsdelivr":"dist/facemesh.min.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/tensorflow/tfjs-models.git"},"peerDependencies":{"@tensorflow/tfjs-converter":"^1.6.1","@tensorflow/tfjs-core":"^1.6.1"},"dependencies":{"@tensorflow-models/blazeface":"0.0.5"},"devDependencies":{"@tensorflow/tfjs-converter":"^1.6.1","@tensorflow/tfjs-core":"^1.6.1","@types/jasmine":"~2.5.53","jasmine":"~3.2.0","jasmine-core":"~3.1.0","rimraf":"~2.6.2","rollup":"~0.58.2","rollup-plugin-node-resolve":"~3.3.0","rollup-plugin-typescript2":"~0.13.0","rollup-plugin-uglify":"~3.0.0","ts-node":"~5.0.0","tslint":"~5.8.0","typescript":"3.3.3333","yalc":"^1.0.0-pre.27"},"scripts":{"build":"rimraf dist && tsc","publish-local":"yarn build && rollup -c && yalc publish","test":"ts-node run_tests.ts","build-npm":"yarn build && rollup -c","lint":"tslint -p . -t verbose","publish-demo":"./scripts/publish-demo.sh"},"license":"Apache-2.0","bugs":{"url":"https://github.com/tensorflow/tfjs-models/issues"},"homepage":"https://github.com/tensorflow/tfjs-models#readme","_id":"@tensorflow-models/facemesh@0.0.2","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"shasum":"d449434b24a928013d57dda6b452b7b3631b8a3d","size":10289362,"noattachment":false,"key":"/@tensorflow-models/facemesh/-/@tensorflow-models/facemesh-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@tensorflow-models/facemesh/download/@tensorflow-models/facemesh-0.0.2.tgz"},"maintainers":[{"name":"annxingyuan","email":""},{"name":"caisq","email":""},{"name":"dedongala","email":""},{"name":"fengwuyao","email":""},{"name":"jinjingforever","email":""},{"name":"linazhao128","email":""},{"name":"linchan","email":""},{"name":"mattsoulanille","email":""},{"name":"pyu10055","email":""}],"_npmUser":{"name":"annxingyuan","email":"annyuan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facemesh_0.0.2_1590001351584_0.02445658838272391"},"_hasShrinkwrap":false,"publish_time":1590001351894,"_cnpm_publish_time":1590001351894,"_cnpmcore_publish_time":"2021-12-17T05:26:54.765Z"},"0.0.1":{"name":"@tensorflow-models/facemesh","version":"0.0.1","description":"Pretrained facemesh model","main":"dist/index.js","jsnext:main":"dist/facemesh.esm.js","module":"dist/facemesh.esm.js","unpkg":"dist/facemesh.min.js","jsdelivr":"dist/facemesh.min.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/tensorflow/tfjs-models.git"},"peerDependencies":{"@tensorflow/tfjs-core":"^1.6.1","@tensorflow/tfjs-converter":"^1.6.1"},"dependencies":{"@tensorflow-models/blazeface":"0.0.5"},"devDependencies":{"@tensorflow/tfjs-core":"^1.6.1","@tensorflow/tfjs-converter":"^1.6.1","@types/jasmine":"~2.5.53","jasmine":"~3.2.0","jasmine-core":"~3.1.0","rimraf":"~2.6.2","rollup":"~0.58.2","rollup-plugin-node-resolve":"~3.3.0","rollup-plugin-typescript2":"~0.13.0","rollup-plugin-uglify":"~3.0.0","ts-node":"~5.0.0","tslint":"~5.8.0","typescript":"3.3.3333","yalc":"^1.0.0-pre.27"},"scripts":{"build":"rimraf dist && tsc","publish-local":"yarn build && rollup -c && yalc publish","test":"ts-node run_tests.ts","build-npm":"yarn build && rollup -c","lint":"tslint -p . -t verbose","publish-demo":"./scripts/publish-demo.sh"},"license":"Apache-2.0","bugs":{"url":"https://github.com/tensorflow/tfjs-models/issues"},"homepage":"https://github.com/tensorflow/tfjs-models#readme","_id":"@tensorflow-models/facemesh@0.0.1","_nodeVersion":"12.7.0","_npmVersion":"6.11.3","dist":{"shasum":"dd620fb49a8ed2fad841471dccd0c73f75deae16","size":10289347,"noattachment":false,"key":"/@tensorflow-models/facemesh/-/@tensorflow-models/facemesh-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/@tensorflow-models/facemesh/download/@tensorflow-models/facemesh-0.0.1.tgz"},"maintainers":[{"name":"annxingyuan","email":""},{"name":"caisq","email":""},{"name":"dedongala","email":""},{"name":"fengwuyao","email":""},{"name":"jinjingforever","email":""},{"name":"linazhao128","email":""},{"name":"linchan","email":""},{"name":"mattsoulanille","email":""},{"name":"pyu10055","email":""}],"_npmUser":{"name":"annxingyuan","email":"annyuan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/facemesh_0.0.1_1583590000529_0.719918914558872"},"_hasShrinkwrap":false,"publish_time":1583590001133,"_cnpm_publish_time":1583590001133,"_cnpmcore_publish_time":"2021-12-17T05:27:11.694Z"}},"readme":"# MediaPipe Facemesh\n\n---\n\n## This repository has been archived in favor of tfjs-models/face-landmarks-detection and will no longer be updated.\n\nPlease refer to [face-landmarks-detection](https://github.com/tensorflow/tfjs-models/tree/master/face-landmarks-detection) for future updates.\n\n---\n\nMediaPipe Facemesh is a lightweight machine learning pipeline predicting 486 3D facial landmarks to infer the approximate surface geometry of a human face ([paper](https://arxiv.org/pdf/1907.06724.pdf)).\n\n<img src=\"demo.gif\" alt=\"demo\" style=\"width: 640px;\"/>\n\nMore background information about the model, as well as its performance characteristics on different datasets, can be found here: [https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view](https://drive.google.com/file/d/1VFC_wIpw4O7xBOiTgUldl79d9LA-LsnA/view)\n\nThe model is designed for front-facing cameras on mobile devices, where faces in view tend to occupy a relatively large fraction of the canvas. MediaPipe Facemesh may struggle to identify far-away faces.\n\nCheck out our [demo](https://storage.googleapis.com/tfjs-models/demos/facemesh/index.html), which uses the model to detect facial landmarks in a live video stream.\n\nThis model is also available as part of [MediaPipe](https://github.com/google/mediapipe/tree/master/mediapipe/models), a\nframework for building multimodal applied ML pipelines.\n\n## Installation\n\nVia script tags:\n\n```html\n<!-- Require the peer dependencies of facemesh. -->\n<script src=\"https://unpkg.com/@tensorflow/tfjs-core@2.1.0/dist/tf-core.js\"></script>\n<script src=\"https://unpkg.com/@tensorflow/tfjs-converter@2.1.0/dist/tf-converter.js\"></script>\n\n<!-- You must explicitly require a TF.js backend if you're not using the tfs union bundle. -->\n<script src=\"https://unpkg.com/@tensorflow/tfjs-backend-wasm@2.1.0/dist/tf-backend-wasm.js\"></script>\n<!-- Alternatively you can use the WebGL backend: <script src=\"https://unpkg.com/@tensorflow/tfjs-backend-webgl@2.1.0/dist/tf-backend-webgl.js\"></script> -->\n```\n\nVia npm:\n\nUsing `yarn`:\n\n    $ yarn add @tensorflow-models/facemesh\n\n    $ yarn add @tensorflow/tfjs-core, @tensorflow/tfjs-converter\n    $ yarn add @tensorflow/tfjs-backend-wasm # or @tensorflow/tfjs-backend-webgl\n\n## Usage\n\nIf you are using via npm, first add:\n\n```js\nconst facemesh = require('@tensorflow-models/facemesh');\n\n// If you are using the WASM backend:\nrequire('@tensorflow/tfjs-backend-wasm'); // You need to require the backend explicitly because facemesh itself does not\n\n// If you are using the WebGL backend:\n// require('@tensorflow/tfjs-backend-webgl');\n```\n\nThen:\n\n```js\n\nasync function main() {\n  // Load the MediaPipe facemesh model.\n  const model = await facemesh.load();\n\n  // Pass in a video stream (or an image, canvas, or 3D tensor) to obtain an\n  // array of detected faces from the MediaPipe graph.\n  const predictions = await model.estimateFaces(document.querySelector(\"video\"));\n\n  if (predictions.length > 0) {\n    /*\n    `predictions` is an array of objects describing each detected face, for example:\n\n    [\n      {\n        faceInViewConfidence: 1, // The probability of a face being present.\n        boundingBox: { // The bounding box surrounding the face.\n          topLeft: [232.28, 145.26],\n          bottomRight: [449.75, 308.36],\n        },\n        mesh: [ // The 3D coordinates of each facial landmark.\n          [92.07, 119.49, -17.54],\n          [91.97, 102.52, -30.54],\n          ...\n        ],\n        scaledMesh: [ // The 3D coordinates of each facial landmark, normalized.\n          [322.32, 297.58, -17.54],\n          [322.18, 263.95, -30.54]\n        ],\n        annotations: { // Semantic groupings of the `scaledMesh` coordinates.\n          silhouette: [\n            [326.19, 124.72, -3.82],\n            [351.06, 126.30, -3.00],\n            ...\n          ],\n          ...\n        }\n      }\n    ]\n    */\n\n    for (let i = 0; i < predictions.length; i++) {\n      const keypoints = predictions[i].scaledMesh;\n\n      // Log facial keypoints.\n      for (let i = 0; i < keypoints.length; i++) {\n        const [x, y, z] = keypoints[i];\n\n        console.log(`Keypoint ${i}: [${x}, ${y}, ${z}]`);\n      }\n    }\n  }\n}\n\nmain();\n\n```\n\n#### Parameters for facemesh.load()\n\n`facemesh.load()` takes a configuration object with the following properties:\n\n* **maxContinuousChecks** - How many frames to go without running the bounding box detector. Only relevant if maxFaces > 1. Defaults to 5.\n\n* **detectionConfidence** - Threshold for discarding a prediction. Defaults to 0.9.\n\n* **maxFaces** - The maximum number of faces detected in the input. Should be set to the minimum number for performance. Defaults to 10.\n\n* **iouThreshold** - A float representing the threshold for deciding whether boxes overlap too much in non-maximum suppression. Must be between [0, 1]. Defaults to 0.3.\n\n* **scoreThreshold** - A threshold for deciding when to remove boxes based on score in non-maximum suppression. Defaults to 0.75.\n\n#### Parameters for model.estimateFace()\n\n* **input** - The image to classify. Can be a tensor, DOM element image, video, or canvas.\n\n* **returnTensors** - (defaults to `false`) Whether to return tensors as opposed to values.\n\n* **flipHorizontal** - Whether to flip/mirror the facial keypoints horizontally. Should be true for videos that are flipped by default (e.g. webcams).\n\n#### Keypoints\n\nHere is map of the keypoints:\n\n<img src=\"mesh_map.jpg\" alt=\"keypoints_map\" style=\"width: 500px; height: 500px\">\n\nThe UV coordinates for these keypoints are available via the `getUVCoords()` method on the `FaceMesh` model object. They can also be found in `src/uv_coords.ts`.\n","_attachments":{},"homepage":"https://github.com/tensorflow/tfjs-models#readme","bugs":{"url":"https://github.com/tensorflow/tfjs-models/issues"},"license":"Apache-2.0"}