{"id":19462616,"url":"https://github.com/webrtchacks/tfobjwebrtc","last_synced_at":"2025-04-25T08:31:21.170Z","repository":{"id":43039187,"uuid":"112856312","full_name":"webrtcHacks/tfObjWebrtc","owner":"webrtcHacks","description":"Tensorflow Object Detection API Web Service wrapper that works on any \u003cvideo\u003e tag and WebRTC streams","archived":false,"fork":false,"pushed_at":"2017-12-11T02:58:37.000Z","size":17,"stargazers_count":179,"open_issues_count":5,"forks_count":51,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-04-15T07:12:43.585Z","etag":null,"topics":["object-detection","tensorflow","webrtc"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/webrtcHacks.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":"2017-12-02T16:08:23.000Z","updated_at":"2024-04-15T07:12:43.585Z","dependencies_parsed_at":"2022-08-30T19:12:19.015Z","dependency_job_id":null,"html_url":"https://github.com/webrtcHacks/tfObjWebrtc","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/webrtcHacks%2FtfObjWebrtc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrtcHacks%2FtfObjWebrtc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrtcHacks%2FtfObjWebrtc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webrtcHacks%2FtfObjWebrtc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webrtcHacks","download_url":"https://codeload.github.com/webrtcHacks/tfObjWebrtc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223992712,"owners_count":17237501,"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":["object-detection","tensorflow","webrtc"],"created_at":"2024-11-10T18:04:16.063Z","updated_at":"2024-11-10T18:04:17.141Z","avatar_url":"https://github.com/webrtcHacks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tensorflow Object Detection API Web Service\n\nThis is an example of how to turn the [TensorFlow Object API](https://github.com/tensorflow/models/tree/master/research/object_detection) into a web service. \nA Python Flask web server is used to interact with a JavaScript a client library. \nThe example shows how you can extract frames from WebRTC's getUserMedia, upload them to the API, and then use the canvas to display them.\nThis allows use of the TensorFlow Object API on any HTML `\u003cvideo\u003e` element.\n\nPlease see the [Computer Vision on the Web with WebRTC and TensorFlow](https://webrtchacks.com/webrtc-cv-tensorflow/) post on \n[webrtcHacks](https://webrtchacks.com) for a walkthrough and more details.\n\nExample image:\n![Detecting Cats](https://webrtchacks.com/wp-content/uploads/2017/12/intro-graphic-3.png)\n\nTensorFlow Object Detection API on a WebRTC getUserMedia stream demo video:\n\n[![TensorFlow Object Detection API on a video element](https://img.youtube.com/vi/vzTXW0hGINM/0.jpg)](https://www.youtube.com/watch?v=vzTXW0hGINM)\n\n\nTensorFlow Object Detection API on a video element demo video:\n\n[![TensorFlow Object Detection API on a video element](https://img.youtube.com/vi/rNkb9vlW2QY/0.jpg)](https://www.youtube.com/watch?v=rNkb9vlW2QY)\n\n\n## Quick start with Docker\n```$xslt\ndocker run -it -p 5000:5000 chadhart/tensorflow-object-detection:runserver\n```\n\n## Installation\n### Docker Install\n\n```$xslt\ngit clone https://github.com/webrtcHacks/tfObjWebrtc.git\ncd tfObjWebrtc\ndocker run -it -p 5000:5000 --name tf-webrtchacks -v $(pwd):/code chadhart/tensorflow-object-detection:webrtchacks\npython setup.py install\npython server.py\n```\n\n### Manual install\n\nFollow the TensorFlow Object API install [instructions](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md).\nThen run the the instructions above.\n\n## Example web apps\n\nPoint your browser to:\n-  `https://localhost:5000/local` - shows a mirrored video from a webcam\n- `https://localhost:5000/video` - shows object detection running on a HTML `\u003cvideo\u003e` tag\n\n## Browser support\n\nWebRTC browsers have secure origin restrictions: \n- Chrome will only work on `localhost` unless you add TLS certificates to your server\n- Firefox will work on any domain as long as you allow it\n- Safari will work, but you will need to \"Allow Media Capture on Insecure Domains\" \n\nThese should all work fine with any other video source.\n\n\nEdge is currently not supported (polyfill for `canvas.toBlob` needed)\n\nSee the webrtcHacks [link](https://webrtchacks.com/webrtc-cv-tensorflow/) for details.\n\n## API Details\n\nPoint to a `\u003cscript\u003e` tag to `objDetect.js` with an id of `objDetect`. Include `data-source=\"myVideo\"` and other optional `data-` tags to set parameters.\n\nExample:\n```$xslt\n\u003cscript id=\"objDetect\" src=\"/static/objDetect.js\" data-source=\"myVideo\" data-mirror=\"true\" data-uploadWidth=\"1280\" data-scoreThreshold=\"0.40\"\u003e\u003c/script\u003e\n```\n\nData tags:\n\n- `data-source` - the ID of the source `\u003cvideo\u003e` to use. Must be specified.\n- `data-uploadWidth` - the width of the upload file. Height will automatically be calculated based on the source video's aspect ratio. Default is `640`.\n- `data-mirror` - mirror the boundary boxes. Used is the image is mirrored (as is usual with a local getUserMedia view). Default is `false`.\n- `data-scoreThreshold` - only show objects above this confidence threshold. Default is `0.5`\n - `data-apiServer` - the full URL of the TensorFlow Object Detection Web API server location. Default is `/image` off of the current domain - \n i.e. `http://localhost:5000/image`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebrtchacks%2Ftfobjwebrtc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebrtchacks%2Ftfobjwebrtc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebrtchacks%2Ftfobjwebrtc/lists"}