{"id":13393231,"url":"https://github.com/auduno/clmtrackr","last_synced_at":"2025-05-14T01:05:34.752Z","repository":{"id":4327593,"uuid":"5462508","full_name":"auduno/clmtrackr","owner":"auduno","description":"Javascript library for precise tracking of facial features via Constrained Local Models","archived":false,"fork":false,"pushed_at":"2020-01-10T15:02:27.000Z","size":59749,"stargazers_count":6515,"open_issues_count":63,"forks_count":1151,"subscribers_count":312,"default_branch":"dev","last_synced_at":"2025-04-10T13:19:00.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/auduno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-18T12:24:43.000Z","updated_at":"2025-04-08T16:30:52.000Z","dependencies_parsed_at":"2022-08-06T16:15:12.652Z","dependency_job_id":null,"html_url":"https://github.com/auduno/clmtrackr","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auduno%2Fclmtrackr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auduno%2Fclmtrackr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auduno%2Fclmtrackr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/auduno%2Fclmtrackr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/auduno","download_url":"https://codeload.github.com/auduno/clmtrackr/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253601000,"owners_count":21934246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T17:00:46.839Z","updated_at":"2025-05-14T01:05:34.717Z","avatar_url":"https://github.com/auduno.png","language":"JavaScript","funding_links":[],"categories":["AI","JavaScript","Uncategorized","JavaScript apps and frameworks","📦 Legacy \u0026 Inactive Projects"],"sub_categories":["Facial","Uncategorized","Face/head tracking"],"readme":"clmtrackr\n======\n\n[![npm version](https://img.shields.io/npm/v/clmtrackr.svg)](https://www.npmjs.com/package/clmtrackr)\n\n![tracked face](https://auduno.github.io/clmtrackr/examples/media/clmtrackr_03.jpg)\n\n**clmtrackr** is a javascript library for fitting facial models to faces in videos or images. It currently is an implementation of *constrained local models* fitted by *regularized landmark mean-shift*, as described in [Jason M. Saragih's paper](http://dl.acm.org/citation.cfm?id=1938021). **clmtrackr** tracks a face and outputs the coordinate positions of the face model as an array, following the numbering of the model below:\n\n[![facemodel_numbering](https://auduno.github.io/clmtrackr/examples/media/facemodel_numbering_new_small.png)](https://auduno.github.io/clmtrackr/examples/media/facemodel_numbering_new.png)\n\n[Reference](http://auduno.github.io/clmtrackr/docs/reference.html) - [Overview](https://www.auduno.com/2014/01/05/fitting-faces/)\n\nThe library provides some generic face models that were trained on [the MUCT database](http://www.milbo.org/muct/) and some additional self-annotated images. Check out [clmtools](https://github.com/auduno/clmtools) for building your own models.\n\nFor tracking in video, it is recommended to use a browser with WebGL support, though the library should work on any modern browser.\n\nFor some more information about Constrained Local Models, take a look at Xiaoguang Yan's [excellent tutorial](https://sites.google.com/site/xgyanhome/home/projects/clm-implementation/ConstrainedLocalModel-tutorial%2Cv0.7.pdf?attredirects=0), which was of great help in implementing this library.\n\n### Examples ###\n\n* [Tracking in image](https://auduno.github.io/clmtrackr/examples/clm_image.html)\n* [Tracking in video](https://auduno.github.io/clmtrackr/examples/clm_video.html)\n* [Face substitution](https://auduno.github.io/clmtrackr/examples/facesubstitution.html)\n* [Face masking](https://auduno.github.io/clmtrackr/examples/face_mask.html)\n* [Realtime face deformation](https://auduno.github.io/clmtrackr/examples/facedeform.html)\n* [Emotion detection](https://auduno.github.io/clmtrackr/examples/clm_emotiondetection.html)\n* [Caricature](https://auduno.github.io/clmtrackr/examples/caricature.html)\n\n### Usage ###\n\nDownload the minified library [clmtrackr.js](https://github.com/auduno/clmtrackr/raw/dev/build/clmtrackr.js), and include it in your webpage.\n\n```html\n/* clmtrackr libraries */\n\u003cscript src=\"js/clmtrackr.js\"\u003e\u003c/script\u003e\n```\n\nThe following code initiates the clmtrackr with the default model (see the [reference](http://auduno.github.io/clmtrackr/docs/reference.html) for some alternative models), and starts the tracker running on a video element.\n\n```html\n\u003cvideo id=\"inputVideo\" width=\"400\" height=\"300\" autoplay loop\u003e\n  \u003csource src=\"./media/somevideo.ogv\" type=\"video/ogg\"/\u003e\n\u003c/video\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  var videoInput = document.getElementById('inputVideo');\n  \n  var ctracker = new clm.tracker();\n  ctracker.init();\n  ctracker.start(videoInput);\n\u003c/script\u003e\n```\n\nYou can now get the positions of the tracked facial features as an array via ```getCurrentPosition()```:\n\n```html\n\u003cscript type=\"text/javascript\"\u003e\n  function positionLoop() {\n    requestAnimationFrame(positionLoop);\n    var positions = ctracker.getCurrentPosition();\n    // positions = [[x_0, y_0], [x_1,y_1], ... ]\n    // do something with the positions ...\n  }\n  positionLoop();\n\u003c/script\u003e\n```\n\nYou can also use the built in function ```draw()``` to draw the tracked facial model on a canvas :\n\n```html\n\u003ccanvas id=\"drawCanvas\" width=\"400\" height=\"300\"\u003e\u003c/canvas\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  var canvasInput = document.getElementById('drawCanvas');\n  var cc = canvasInput.getContext('2d');\n  function drawLoop() {\n    requestAnimationFrame(drawLoop);\n    cc.clearRect(0, 0, canvasInput.width, canvasInput.height);\n    ctracker.draw(canvasInput);\n  }\n  drawLoop();\n\u003c/script\u003e\n```\n\nSee the complete example [here](https://auduno.github.io/clmtrackr/examples/example.html).\n\n### Development ###\n\nFirst, install [node.js](http://nodejs.org/) with npm.\n\nIn the root directory of clmtrackr, run `npm install` then run `npm run build`. This will create `clmtrackr.js` and `clmtrackr.module.js` in `build` folder.\n\nTo test the examples locally, you need to run a local server. One easy way to do this is to install `http-server`, a small node.js utility: `npm install -g http-server`. Then run `http-server` in the root of clmtrackr and go to `https://localhost:8080/examples` in your browser.\n\n### License ###\n\n**clmtrackr** is distributed under the [MIT License](http://www.opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauduno%2Fclmtrackr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauduno%2Fclmtrackr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauduno%2Fclmtrackr/lists"}