{"id":21278771,"url":"https://github.com/tugot17/yolo-object-counting-api","last_synced_at":"2025-07-11T08:33:28.972Z","repository":{"id":46092415,"uuid":"228175980","full_name":"tugot17/YOLO-Object-Counting-API","owner":"tugot17","description":"The code of the Object Counting API, implemented with the YOLO algorithm and with the SORT algorithm","archived":false,"fork":false,"pushed_at":"2020-04-10T09:05:56.000Z","size":73759,"stargazers_count":191,"open_issues_count":3,"forks_count":56,"subscribers_count":7,"default_branch":"master","last_synced_at":"2023-10-20T23:33:52.727Z","etag":null,"topics":["computer-vision","object-counter","object-counting","object-counting-api","object-detection","opencv","pedestrian-detection","pedestrian-tracking","tensorflow","traffic-analysis","vehicle-detection","vehicle-tracking","yolo","yolo-object-counting-api","yolov2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tugot17.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":"2019-12-15T11:52:05.000Z","updated_at":"2023-10-19T08:17:54.000Z","dependencies_parsed_at":"2022-07-31T04:37:52.615Z","dependency_job_id":null,"html_url":"https://github.com/tugot17/YOLO-Object-Counting-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugot17%2FYOLO-Object-Counting-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugot17%2FYOLO-Object-Counting-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugot17%2FYOLO-Object-Counting-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tugot17%2FYOLO-Object-Counting-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tugot17","download_url":"https://codeload.github.com/tugot17/YOLO-Object-Counting-API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225708272,"owners_count":17511635,"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":["computer-vision","object-counter","object-counting","object-counting-api","object-detection","opencv","pedestrian-detection","pedestrian-tracking","tensorflow","traffic-analysis","vehicle-detection","vehicle-tracking","yolo","yolo-object-counting-api","yolov2"],"created_at":"2024-11-21T10:16:02.807Z","updated_at":"2024-11-21T10:16:03.447Z","avatar_url":"https://github.com/tugot17.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOLO-Object-Counting-API\nReal time Object Counting api. Implemented with the [YOLO](https://arxiv.org/pdf/1612.08242.pdf) algorithm and with the [SORT](https://arxiv.org/pdf/1703.07402.pdf) algorithm\n\nThe implementation is using model in same format as darkflow and darknet. Weight files, as well as cfg files can be found [here](http://pjreddie.com/darknet/yolo/). Darklow supports only YOLOv1 and YOLOv2. Support for YOLOv3 has not yet been implemented.\n\nIn order to achieve the best performance, you should have Cuda and tensorflow-gpu installed on Your device. \n\n## Demo\n### Count objects of a specified class crossing a virtual line\n\n\n#### Counting pedestrains \n\u003cp align=\"center\"\u003e \u003cimg src=\"inputs/pedestrians_output.gif\"/\u003e \u003c/p\u003e\n\n#### Highway traffic counting\n\n\u003cp align=\"center\"\u003e \u003cimg src=\"inputs/highway_traffic_output.gif\"/\u003e \u003c/p\u003e\n\n### Count objects on a video\n\n\u003cp align=\"center\"\u003e \u003cimg src=\"inputs/count_objects_on_video.gif\"/\u003e \u003c/p\u003e\n\n### Count objects on a single frame\n\n\u003cp align=\"center\"\u003e \u003cimg src=\"inputs/count_people_output.jpg\"/\u003e \u003c/p\u003e\n\n\n# Set up\n## Dependencies\n\n```\n-tensorflow 1.0\n-numpy\n-opencv 3\n```\n\n## Getting started\n\nYou can choose _one_ of the following three ways to get started with darkflow.\n\n1. Just build the Cython extensions in place. NOTE: If installing this way you will have to use `./flow` in the cloned darkflow directory instead of `flow` as darkflow is not installed globally.\n    ```\n    python3 setup.py build_ext --inplace\n    ```\n\n2. Let pip install darkflow globally in dev mode (still globally accessible, but changes to the code immediately take effect)\n    ```\n    pip3 install -e .\n    ```\n\n3. Install with pip globally\n    ```\n    pip3 install .\n    ```\n\n## Required files\n\nThe YOLO algoritym impementation used in this project requires 3 files. Configuration of network (.cfg), trained weights (.weights) and labels.txt. \n\nYOLO implementation used in this project enables usage of YOLOv1 and YOLOv2, and its tiny versions. Support for YOLOv3 has not yet been implemented.\n\n\n### .cfg files\nConfiguration file determines a network architecture. Configurations can be found [here](http://pjreddie.com/darknet/yolo/). In example scripts we assume that the configuration is placed in cfg/ folder. Location of used .cfg file is specyfied in the options object used in the code. \n\nThe .cfg file can be downloaded using the following command: \n```bash\nwget https://raw.githubusercontent.com/pjreddie/darknet/master/cfg/yolov2.cfg -O cfg/yolov2.cfg\n```\n### .weights files\nThe .weights files contain trained parameters of a network. In example scripts we assume the weights are placed in bin/ folder. Location of used .weights file is specyfied in the options object used in the code.\n\nThe .weights file can be downloaded using the following command:\n```bash\nwget https://pjreddie.com/media/files/yolov2.weights -O bin/yolov2.weights\n```\n### labels.txt files\n\nThis file is list of classes detected by a YOLO netowork. It shoud contain as many classes as it is specyfied in a .cfg file. \n\n## Run counting\n\nOnce You have all dependencies instaled and all required files You can start counting objects. Object counting is carried out by an ObjectCuntingAPI object.\n\nExamples of counting below\n\n### Count cars on crosing a virtual line \n```bash\npython3 count_cars_crosing_virtual_line.py\n```\n\n### Count objects on video from Video Camera \n```bash\npython3 count_objects_from_camera.py\n```\n\n### Count people on image \n```bash\npython3 count_people_on_image.py\n```\n\n## Credits\nThe following open source projects were used in the implementation\n\n### Darkflow\n\nThe YOLO algorithm impementation  - [Darkflow](https://github.com/thtrieu/darkflow)\n\n### Python Traffic Counter\n\n[Object counting with YOLO and SORT](https://github.com/bharath5673/python-traffic-counter-with-yolo-and-sort). Similar project, but instead of using the darklow YOLO implementation, it uses the opencv YOLO implementation, so there is no GPU acceleration.\n\n### Deep Sort \nObject tracking and counting - [SORT](https://github.com/abewley/sort)\n\n## Images and Videos sources\nHighway surveillance [video](https://www.youtube.com/watch?v=PJ5xXXcfuTc)\n\nPedestrian surveillance [video](https://www.youtube.com/watch?v=aUdKzb4LGJI)\n\n## Authors\n* [tugot17](https://github.com/tugot17)\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details\n\n\nThat's all.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftugot17%2Fyolo-object-counting-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftugot17%2Fyolo-object-counting-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftugot17%2Fyolo-object-counting-api/lists"}