An open API service indexing awesome lists of open source software.

https://github.com/nvinayvarma189/object-counting-video


https://github.com/nvinayvarma189/object-counting-video

Last synced: 6 months ago
JSON representation

Awesome Lists containing this project

README

          

# Object Counting Video

Table of Contents




  1. About The Project



  2. Getting Started


  3. Usage

  4. Contributing

  5. License

  6. References

## 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.

![counting_input](https://user-images.githubusercontent.com/30727381/123505490-0189db80-d67d-11eb-9c0f-9077c470fa08.png)
![counting_output](https://user-images.githubusercontent.com/30727381/123505493-051d6280-d67d-11eb-94d5-cce437d10b8b.png)

### 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)