{"id":13642752,"url":"https://github.com/shaqian/tfjs-yolo","last_synced_at":"2025-04-20T20:32:44.189Z","repository":{"id":41440539,"uuid":"155080216","full_name":"shaqian/tfjs-yolo","owner":"shaqian","description":"YOLO v3 and Tiny YOLO v1, v2, v3 with Tensorflow.js","archived":false,"fork":false,"pushed_at":"2019-04-11T11:40:51.000Z","size":79,"stargazers_count":111,"open_issues_count":3,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-18T00:16:51.919Z","etag":null,"topics":["tiny-yolo","yolo","yolo-tiny","yolov2","yolov3"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tfjs-yolo","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/shaqian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-28T14:31:31.000Z","updated_at":"2023-11-10T12:12:43.000Z","dependencies_parsed_at":"2022-09-01T13:41:00.168Z","dependency_job_id":null,"html_url":"https://github.com/shaqian/tfjs-yolo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaqian%2Ftfjs-yolo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaqian%2Ftfjs-yolo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaqian%2Ftfjs-yolo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaqian%2Ftfjs-yolo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaqian","download_url":"https://codeload.github.com/shaqian/tfjs-yolo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249959067,"owners_count":21351764,"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":["tiny-yolo","yolo","yolo-tiny","yolov2","yolov3"],"created_at":"2024-08-02T01:01:35.839Z","updated_at":"2025-04-20T20:32:41.115Z","avatar_url":"https://github.com/shaqian.png","language":"JavaScript","funding_links":[],"categories":["Other Versions of YOLO"],"sub_categories":[],"readme":"# tfjs-yolo\n\n[`YOLO`](https://pjreddie.com/darknet/yolo/) object detection with [Tensorflow.js](https://js.tensorflow.org/). Supports YOLO v3 and Tiny YOLO v1, v2, v3.\n\n## Demo\n\n- Detect objects using your webcam:\nhttps://shaqian.github.io/tfjs-yolo-demo/\n![demo](https://github.com/shaqian/tfjs-yolo-demo/raw/master/demo.gif)\n\n- Not hotdog PWA: https://shaqian.github.io/Not-Hotdog/\n\n## Install\n```\nnpm install tfjs-yolo\n```\n\n## Usage\n\n### Import module\n\n```javascript\nimport yolo from 'tfjs-yolo';\n```\n\n### Initialize and load model\n\n```javascript\n// Use default models (stored in my GitHub demo repo)\nlet myYolo = await yolo.v1tiny();\nlet myYolo = await yolo.v2tiny();\nlet myYolo = await yolo.v3tiny();\nlet myYolo = await yolo.v3();\n\n// or specify path or handler, see https://js.tensorflow.org/api/0.13.3/#loadModel\nlet myYolo = await yolo.v3tiny(\"https://.../model.json\");\n\n// or use frozen model, see https://js.tensorflow.org/api/0.13.3/#loadFrozenModel\nlet myYolo = await yolo.v3tiny(\n  \"https://.../weights_manifest.json\",\n  \"https://.../tensorflowjs_model.pb\"\n);\n\n```\n\n### Run model\n\nSupported input html element:\n- img\n- canvas\n- video\n\n```javascript\nconst boxes = await myYolo.predict(canvas);\n\n// Optional settings\nconst boxes = await myYolo.predict(\n  canvas,\n  {\n    maxBoxes: 5,          // defaults to 20\n    scoreThreshold: .2,   // defaults to .5\n    iouThreshold: .5,     // defaults to .3\n    numClasses: 80,       // defaults to 80 for yolo v3, tiny yolo v2, v3 and 20 for tiny yolo v1\n    anchors: [...],       // See ./src/config.js for examples\n    classNames: [...],    // defaults to coco classes for yolo v3, tiny yolo v2, v3 and voc classes for tiny yolo v1\n    inputSize: 416,       // defaults to 416\n  }\n);\n```\n\n### Output box format\n\n```javascript\n{\n  top,    // Float\n  left,   // Float\n  bottom, // Float\n  right,  // Float\n  height, // Float\n  width,  // Float\n  score,  // Float\n  class   // String, e.g. person\n}\n```\n\n### Dispose model\n\n```javascript\nmyYolo.dispose();\n```\n\n## Credits\n\n- https://github.com/qqwweee/keras-yolo3\n- https://github.com/zqingr/tfjs-yolov3\n- https://github.com/ModelDepot/tfjs-yolo-tiny\n- https://github.com/allanzelener/YAD2K","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaqian%2Ftfjs-yolo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaqian%2Ftfjs-yolo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaqian%2Ftfjs-yolo/lists"}