Movement classification
The goal of this project would be movement classification of people, in other words, walking (normal and fast) and running.
Yolov4 will be used for detection.
Yolov4 detection
Yolo: Real-Time object detection
You only look once (YOLO) is a state-of-the-art, real-time object detection system.
Currently the most advanced YOLO version is YOLOv4 which provides optimal speed and accuracy for object detection, therefore it will be used.
Modules
Before starting, usage of a virtual environment is advised via the venv
module:
$ python3 -m venv envname # to create the virtual env
$ source envname/bin/activate # activate it
$ deactivate # when done
For ease of use, the yolov4
Python module was used, which is a YOLOv4 implementation in TensorFlow 2. For further documentation refer to the project wiki
To install yolov4
:
Dependencies:
$ python3 -m pip install opencv-python tensorflow
Note: If TensorFlow Lite needs to be used, refer to the project wiki for further instructions.
TensorFlow YOLOv4:
$ python3 -m pip install yolov4
Download the yolov4-tiny
and yolov4
weights to the weights/
directory from the project wiki weights download section.
Test yolov4
with the provided default test image. Change model config, weights based on the one used (default is yolov4-tiny
).
$ python3 test.py
Test results
KACAVIS runaway_walk_1.mp4 frame 1471 was used:
YOLOv4 | YOLOv4-tiny |
---|---|
Help
>>> from yolov4.tf import YOLOv4
>>> help(YOLOv4)
Dataset
Download the dataset:
wget -O dataset/crowd_simulation_dataset.zip http://kacavis.zemris.fer.hr/datasets/Crowd_simulation_dataset_videos.zip
Pip freeze
To get the used module versions, in other words $ python3 -m pip freeze
, take a look at:
./pip_freeze.txt
Tested on Archlinux 5.12.x-arch1-1
, python version Python 3.9.5
If working on Arch change python3
to python
everywhere.