Traffic participants (pedestrians, busses, cars and trucks) recognition, localization and classification on real time video made using various ML models from YOLO family, specifically: YOLOv3, YOLOv3-tiny, YOLOv4-tiny. Above all, we also hand-made one YOLOv3 implementation to compare with these pre-configured models. Handmade model is heavily inspired by pjreddie's and experiencor's implementations. All models have been configured to run using CPU only.
All required packages can be found in requirements.txt file. You can install them using pip:
pip install -r requirements.txt
.
It is recommended that you do that inside a virtual environment.
Files necessary for testing and running are inside zip archives which you can download from Google Drive. After you download these zip archives, extract them on the project's root level.
Archives:
You can run the project like any other python script:
python main.py args...
If you are using Linux, you may need to specify python version as well.
args... is only a placeholder for command line arguments.
Only -rrtv and -a arguments can be placed alongside each other.
These options can also be viewed by running the main.py
file with -h
flag enabled.
Short option | Long option | Description |
---|---|---|
-map | --meanAveragePrecision | Calculates mean average precision. Defaults to analyzing handmade model. |
-smh | --simpleMetricsHandmade | Calculates simple metrics for handmade model (accuracy, precision, recall and f-value). |
-smp | --simpleMetricsPreconfigured | Calculates simple metrics for preconfigured model (accuracy, precision, recall and f-value). Defaults to 'yolov4-tiny.' |
-vpi | --visualizePredictionsImage | Visualize predictions for image. Defaults to '1.png' in images folder. |
-rrtv | --runRealTimeVideo | Run on video. Defaults to 'test.mp4' in demo_videos folder. |
-a | --algorithm | Choose algorithm to run on video. Defaults to 'yolov4-tiny'. |
-
https://jonathan-hui.medium.com/map-mean-average-precision-for-object-detection-45c121a31173
-
https://towardsdatascience.com/yolo-v3-explained-ff5b850390f
-
https://towardsdatascience.com/yolo-v3-object-detection-with-keras-461d2cfccef6
-
https://www.pyimagesearch.com/2018/11/12/yolo-object-detection-with-opencv/
-
https://towardsdatascience.com/object-detection-using-yolov3-and-opencv-19ee0792a420
-
https://github.com/muhammadshiraz/YOLO-Real-Time-Object-Detection