Home

Awesome

YOLOV3


Introduction

This is my own YOLOV3 written in pytorch, and is also the first time i have reproduced a object detection model.The dataset used is PASCAL VOC. The eval tool is the voc2010. Now the mAP gains the goal score.

Subsequently, i will continue to update the code to make it more concise , and add the new and efficient tricks.

Note : Now this repository supports the model compression in the new branch model_compression


Results

nameTrain DatasetVal DatasetmAP(others)mAP(mine)notes
YOLOV3-448-5442007trainval + 2012trainval2007test0.7690.768 | -baseline(augument + step lr)
YOLOV3-*-5442007trainval + 2012trainval2007test0.7930.803 | -+multi-scale training
YOLOV3-*-5442007trainval + 2012trainval2007test0.8060.811 | -+focal loss(note the conf_loss in the start is lower)
YOLOV3-*-5442007trainval + 2012trainval2007test0.8080.813 | -+giou loss
YOLOV3-*-5442007trainval + 2012trainval2007test0.8120.821 | -+label smooth
YOLOV3-*-5442007trainval + 2012trainval2007test0.8220.826 | -+mixup
YOLOV3-*-5442007trainval + 2012trainval2007test0.8330.832 | 0.840+cosine lr
YOLOV3-*-*2007trainval + 2012trainval2007test0.8580.858 | 0.860+multi-scale test and flip, nms threshold is 0.45

Note :


Environment

# install packages
pip3 install -r requirements.txt --user

Brief


Prepared work

1、Git clone YOLOV3 repository

git clone https://github.com/Peterisfar/YOLOV3.git

update the "PROJECT_PATH" in the params.py.

2、Download dataset

cd YOLOV3 && mkdir data
cd utils
python3 voc.py # get train_annotation.txt and test_annotation.txt in data/

3、Download weight file

Make dir weight/ in the YOLOV3 and put the weight file in.


Train

Run the following command to start training and see the details in the config/yolov3_config_voc.py

WEIGHT_PATH=weight/darknet53_448.weights

CUDA_VISIBLE_DEVICES=0 nohup python3 -u train.py --weight_path $WEIGHT_PATH --gpu_id 0 > nohup.log 2>&1 &

Notes:


Test

You should define your weight file path WEIGHT_FILE and test data's path DATA_TEST

WEIGHT_PATH=weight/best.pt
DATA_TEST=./data/test # your own images

CUDA_VISIBLE_DEVICES=0 python3 test.py --weight_path $WEIGHT_PATH --gpu_id 0 --visiual $DATA_TEST --eval

The images can be seen in the data/


TODO


Reference