This is a YOLOV3 baseline written in PyTorch. The eval dataset used is PASCAL VOC(not use difficulty). The eval tool is the cocoAPI. The mAP gains the score as same as the original paper. Subsequently, we will continue to update the code by adding some new and efficient methods to make it more concise, lighter, faster in vehicle detection.
name | Train Dataset | Val Dataset | mAP(mine) | notes |
---|---|---|---|---|
YOLOV3-*-544 | 2007trainval + 2012trainval | 2007test | 0.835 | +cosine lr + multi-scale + smooth_L1 |
YOLOV3-*-544 | 2007trainval + 2012trainval | cocoAPI | 0.821 | +cosine lr + multi-scale + smooth_L1 |
Implement | Backbone | Input Size | Batch Size | Inference Time | FPS |
---|---|---|---|---|---|
Paper | Darknet53 | 320 | 1 | 22ms | 45 |
Paper | Darknet53 | 416 | 1 | 29ms | 34 |
Paper | Darknet53 | 608 | 1 | 51ms | 19 |
Our | Darknet53 | 320 | 1 | 23ms | 43 |
Our | Darknet53 | 416 | 1 | 27ms | 36 |
Our | Darknet53 | 608 | 1 | 40ms | 29 |
Note
:
- YOLOV3-*-544 means test image size is 544.
"*"
means the multi-scale. - In the test, the nms threshold is 0.5 and the conf_score is 0.01.
- Now only support the single gpu to train and test.
Note
: This is just a reference, the environment doesn’t have to be exactly the same.
- Nvidia GeForce RTX 1080 Ti
- CUDA10.1
- CUDNN7.6.0
- ubuntu 18.04
# install packages
pip install -r requirements.txt
- Data Augmentation (SSD Augmentation methods)
- Step lr Schedule
- Multi-scale Training (320 to 608)
- cosine lr
git clone https://gitee.com/vehicle_1/YOLOV3_SUPER.git
- Download Pascal VOC dataset : VOC data.zip Passwords: 7vfh
- The organizational structure of this data will be presented below:
|--voc_data
|--|--VOCtest-2007
|--|--|--VOCdevkit
|--|--|--|--VOC2007
|--|--VOCtrainval-2007
|--|--|--VOCdevkit
|--|--|--|--VOC2007
|--|--VOCtrainval-2012
|--|--|--VOCdevkit
|--|--|--|--VOC2012
- Download Pascal VOC dataset : U-DETRAC
- The organizational structure of this data will be presented below:
|--U-DETRA_dataset
|--|--DETRAC-Test-Annotations-XML
|--|--DETRAC-Train-Annotations-XML
|--|--DETRAC-test-data
|--|--DETRAC-train-data
- first
we should first adjust the config params in./train/Detrac_data_preprocess/params_init_Detrac
or./train/Voc_data_preprocess/params_init_voc
We should pay attention to the settings of these parameters:
*"data_path" *"working_dir" *"DATA_PATH" *"PROJECT_PATH" - second
cd train/Detrac_data_preprocess
python Detrac_data_process.py
or
cd train/Voc_data_preprocess
python voc_data_process.py
then the dataset is ready
- third
cd evaluate/evaluate_coco
python voc_convert2_coco.py --xml_dir ~~~
or
cd evaluate/evaluate_detrac_coco_api
python Detrac_convert2_coco.py
then the evaluation's gt_json for evaluate is ready
- Darknet pre-trained weight : darknet53.conv.74
- Darknet COCO-pretrained pth : darknet53_weights_pytorch.pth
Make dir weight/
in the YOLOV3 and put the weight file in.
Run the following command to start training and see the details in the darknet53/name/time_id/log.txt
cd train/
python train_model.py --config_name "VOC" --device_id 0 --config_model_name "yolov3"
You should config evaluate/evaluate_coco/yolov3_config_voc_test.py
or evaluate/evaluate_detrac_coco_api/yolov3_config_dtrac_test.py
cd evaluate/evaluate_coco/
python coco_eval_voc.py
cd evaluate/evaluate_detrac_coco_api/
python coco_eval_detrac.py
The images can be seen in the evaluate/evaluate_coco/data/results
orevaluate/evaluate_detrac_coco_api/data/results
- model compression
- focal loss
- GIOU
- Label smooth
- Mixup
- Mobilenet v1-v3
- Mossaic
- Poly-yolo
- Gaussian-yolo
- centernet-Gaussian kernel
- pytorch : https://github.com/ultralytics/yolov3
- pytorch : https://github.com/Peterisfar/YOLOV3