A YOLOv4-MobileNet object detection pipeline inherited from keras-YOLOv3-model-set and keras-yolo3-Mobilenet. Implement with keras, including model training/tuning, model evaluation and on device deployment. The model supports dataset called SYGData0829 collected by our team and including 4 classes which are 'motor,bike,truck,bus'.
- Python 3.6.5
- Tensorflow 1.15.0
- Keras 2.2.5
To download SYGData0829 dataset, you need to follow the steps below:
- Go to the github repo
- Select
SYGData0829.zip.001
、SYGData0829.zip.002
、SYGData0829.zip.003
、SYGData0829.zip.004
and download archive - Unpack archive
unzip -zvf SYGData0829.zip -d <path_same_with_train.py>
cd <path_same_with_train.py>
python voc_annotation.py
You will get 3 files which the model will load the related dataset according to.
You can directly run the file with the default parameters.
python train.py
or you can modify train.py to set
annotation_path
,classes_path
,anchors_path
,weights_path
,log_dir
, Init_epoch
,Freeze_epoch
,batch_size
,learning_rate_base
,
Freeze_epoch
,Epoch
and other train parameters, then run the files.
If you want to test image,modify FLAG
as True
in the file yolo_image.py,
make dictionary named img and put test images, then
python yolo_image.py
If you want to test video,make dictionary named video and put test videos, modify video_path
in the file
yolo_image.py, then
python yolo_image.py
- modify
all_path
andsave_path
in the file get_gt_txt1.py to get the ground-truth in the test dataset. - modify
all_path
andsave_path
in the file get_dr_txt2.py to get the detection-result and images-optional in the test dataset. - modify
MINOVERLAP
in the file get_map3.py to calculate mAP.
python get_gt_txt1.py
python get_dr_txt2.py
python get_map3.py
Metric | Value |
---|---|
AP@motor | 94.5% |
AP@truck | 57% |
AP@bus | 86% |
AP@car | 77% |
mAP | 67.84% |