https://github.com/nvinayvarma189/object-counting-video
https://github.com/nvinayvarma189/object-counting-video
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nvinayvarma189/object-counting-video
- Owner: nvinayvarma189
- License: mit
- Created: 2021-06-24T08:56:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-26T08:32:59.000Z (over 4 years ago)
- Last Synced: 2025-02-08T06:12:14.667Z (8 months ago)
- Language: Python
- Size: 40 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Object Counting Video
Table of Contents
## About The Project
A simple program to calculate the cumulative count of instances of one or more objects present in a video. Confidence thresholds, line placement, objects list, etc are customizable to make it as generic as possible.

### Built With
* [YoloV3](https://arxiv.org/abs/1804.02767)
* [OpenCV](https://opencv.org/)
* [Python3](https://www.python.org/)## Getting Started
To get a local copy up and running:
### Prerequisites
1. `git clone https://github.com/nvinayvarma189/object-counting-video`
2. `cd object-counting-video && mkdir input/ && mkdir output/`
3. Downlaod a traffic video clip such as [this](https://www.youtube.com/watch?v=jjlBnrzSGjc) and place it unde `input` folder under your `object-counting-video` folder.
4. Downlaod [Yolov3 weights](https://pjreddie.com/media/files/yolov3.weights) file and place in under [`yolo-coco`](https://github.com/nvinayvarma189/object-counting-video/tree/main/yolo-coco) folder.### Installation
1. `python -m venv env`
2. `source env/bin/activate`
3. `pip install -r requirements.txt`### Usage
1. If you have the above-mentioned prerequisites and have followed the installation steps then you can run this command
- `python main.py count_objects_in_video`
2. If you want to pass any arguments to the script, you can do pass them like this
- `python main.py count_objects_in_video --input_video_path='/some/custom/path`
- `python main.py count_objects_in_video --line_coords='[(x1, y1,), (x2, y2)]'`
- `python main.py count_objects_in_video --output_json_path='/some/custom/path/output.json`
- `python main.py count_objects_in_video --objects_to_count='["object1", "object2", "object3"]`
3. To list all possible arguments along with their default values:
- `python main.py -- --help`### Contributing
Coming Soon...
### License
This repository is licensed with the [MIT License](https://github.com/nvinayvarma189/object-counting-video/blob/main/LICENSE)
### References
- [YoloV3 paper](https://arxiv.org/abs/1804.02767) and [Pretrained YoloV3 weights](https://pjreddie.com/media/files/yolov3.weights)
- [Object Detection and Tracking blog post](https://towardsdatascience.com/object-detection-and-tracking-in-pytorch-b3cf1a696a98)
- [SORT: A Simple, Online and Realtime Tracker](https://github.com/abewley/sort/blob/master/sort.py)
- [Object counting using Yolo and Sort](https://github.com/HodenX/python-traffic-counter-with-yolo-and-sort)