/person_counter

Count number of person in an image/video using OpenCV-Python framework.

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

Count number of person in a video or image


About

It is a project I made during my one month internship for Artificial Intelligence - Computer Vision & Open CV that count the number of person in a video or image. It is based on the opencv library.

Usage

python src/__main__.py -i | --image | -v | --video <path/to/image/or/video>

Press q to exit output window

Dependencies

Installation of dependencies

  • Run the following command in the terminal:
pip install -r requirements.txt

If you want to install latest version of dependencies, run the following command in the terminal:

pip install -r requirements.txt --upgrade

or

pip install imutils opencv-python

Usage

usage: main.py [-h] [-v VIDEO] [-i IMAGE]

options:
-h, --help            show this help message and exit
-v VIDEO, --video VIDEO
                        path to Video File
-i IMAGE, --image IMAGE
                        path to Image File

Example:

> python main.py -v assets/output/people.mp4
[INFO] Opening Image from path.
[INFO] Press q to close window.
[INFO] User Requested An Interrupt.
[INFO] Quitting...

Output:

detect_by_image.jpg

> python main.py -i assets/output/people.jpg
[INFO] Opening Video from path.
[INFO] Press q to close window.
Detecting people...
[INFO] User Requested An Interrupt.
[INFO] Quitting...

detect_by_video.mp4

Want to contribute to this project?

Follow the Contributing Guide


Made with ❤ by Hemant Sachdeva