Skip to content

qq751220449/yolov3_tensorflow_python3

Repository files navigation

Initial with Darknet53-448.weights

Performance(Better performance than Tencent's reimplementation)

train dataset: VOC 2012 + VOC 2007
test dataset: VOC 2007
test size: 544
test code: Faster rcnn (not use 07 metric)
test score threshold: 0.01

modelmAPdeltarelease
baseline73.30.0yes
data agumentation76.9+3.6yes
multi scale train79.3+2.4yes
focal loss80.6+1.3yes
group normalizationxxx-0.5yes
soft nmsxxx-0.6yes
mix up81.7+1.1yes
label smooth82.1+0.4yes
cosine learning rate83.1+1.0yes
GIOU83.3+0.2yes
remove anchor83.30yes
multi scale test85.82.5yes

Usage

  1. clone YOLO_v3 repository

    git clone https://github.com/qq751220449/yolov3_tensorflow.git
  2. prepare data
    (1) create your datasets
    Create a new folder named data in the directory where the yolov3_tensorflow folder is located, and then create a new folder named VOC2007 in the data/.
    Then put datasets into data/VOC2007.

    The file structure is as follows:
    |--yolov3_tensorflow
    |--|--v1
    |--|--v2
    |--|--v3
    |--data
    |--|--VOC2007
    |--|--|--Annotations
    |--|--|--ImageSets
    |--|--|--|--Main
    |--|--|--JPEGImages
    (2) convert data format
    You should alter DATASET_PATH and PROJECT_PATHin config.py, for example:
    DATASET_PATH = /home/ice2019/yolov3_temsorflow/data
    PROJECT_PATH = /home/ice2019/yolov3_temsorflow
    and then

    cd yolov3_tensorflow/utils
    python voc.py
  3. prepare initial weights
    Download darknet53_448.weights firstly, put the initial weights into darknet2tf/, and then

    cd darknet2tf
    python3 convert_weights.py --weights_file=darknet53_448.weights --data_format=NHWC
  4. train

    nohup python train.py &
  5. test
    If you want to get a higher mAP, you can set the score threshold to 0.01、use multi scale test、flip test.
    If you want to use it in actual projects, or if you want speed, you can set the score threshold to 0.2.

    nohup python test.py --gpu=0 -t07 &
  6. continue train
    You should alter Continue_To_Train and CHECKPOINT_FILEin config.py, for example:
    Continue_To_Train = True
    CHECKPOINT_FILE = 'checkpoint/yolo.ckpt-99-0.7929'

  7. convert checkpoint to pb file
    You should alter CKPT2PB_CKPT_FILE and CKPT2PB_PB_NAMEin config.py, for example:
    CKPT2PB_CKPT_FILE = 'checkpoint/yolo.ckpt-99-0.7929'
    CKPT2PB_PB_NAME = 'frozen_model_20200103_99_7929.pb'

Reference:

paper:

Requirements

software

  • Python3.6.5
  • Numpy1.14.5
  • Tensorflow.1.10.0
  • Opencv3.4.1

hardware

  • 8G 1080

About

yolov3的Tensorflow实现--基于Python3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published