Update 2020/08/11: First release of People Tracker and Counter. This version detects people and their gender in a video frame, track them, count total number of people that go up or down, and write an annotated output video.
People Tracker and Counter is a program that created as an academic assignment by Ammar Chalifah, supported by Bisa AI (an educative AI company based in Indonesia) and Biomedical Engineering Department of Insitut Teknologi Bandung. The aim of this work is to create a working surveillance program utilising Computer Vision to help retail stores to collect stores' statistics: total number of customer, their gender, and the timestamp of each identified customer.
Based on my set up and dataset, using efficientdet_d0_coco17_tpu-32
model from TensorFlow 2 Model Zoo as the
object detection model, MS COCO label map, and Anant Singh's gender classifier model, I got multiple object
tracking accuracy (MOTA) of 50%.
Current Features:
If there any technical questions related to the project, please post an issue or contact me at:
Library requirements listed below:
models
directory inside the people-tracker-and-counter directory.
git clone https://github.com/ammarchalifah/people-tracker-and-counter.git
cd people-tracker-and-counter
mkdir models
people-tracker-and-counter/models
. For example:
people-tracker-and-counter
└───models
├──efficientdet_d0_coco17_tpu-32
| ├───checkpoint
| └───saved_model
| └───variables
└───model.h5
people-tracker-and-counter/detection_video.py
with your text editor. Go to line 116 and create a new item in the dict modelname
. Put your object
detection model's directory as the value and assign an arbitrary key. Later on, you just have to pass the key as an argument when you call the program via terminal.
modelname = {
'ssd mobilenet':'ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8',
'centernet':'centernet_hg104_1024x1024_kpts_coco17_tpu-32',
'faster rcnn inception': 'faster_rcnn_inception_resnet_v2_1024x1024_coco17_tpu-8',
'faster rcnn resnet101': 'faster_rcnn_resnet101_v1_1024x1024_coco17_tpu-8',
'ssd resnet fpn': 'ssd_resnet50_v1_fpn_640x640_coco17_tpu-8',
'efficientdet':'efficientdet_d0_coco17_tpu-32'
}
print('[INFO] loading gender classifier model...')
gender_model = load_model('models/model.h5')
g_classes = ['woman', 'man']
print('[INFO] gender classifier model loaded')
videos
directory.python detection_video.py -i videos/PATH-TO-VIDEO
python detection_video.py -m models/PATH-TO-MODEL -i videos/PATH-TO-VIDEO -f INTEGER -c ['person'] -d INTEGER -l INTEGER -g BOOLEAN -o videos/output.avi