Skip to content

Repository files navigation

tf_yolov4

license

English | Chinese

Introduction

A tensorflow implementation of YOLOv4 inspired by https://github.com/AlexeyAB/darknet.

Frame code from https://github.com/YunYang1994/tensorflow-yolov3.

Backbone: CSPDarknet53[1], Mish[2];

Neck: SPP[3], PAN[4];

Head: YOLOv3(Leaky_ReLU)[10];

Loss: DIOU CIOU[5], Focal_Loss[6]; Other: Label_Smoothing[7];


Evaluate

GeForce GTX 1080 Ti:

Train and Val sets: VOCtrainval_11-May-2012; Test set: VOCtest_06-Nov-2007;

Network Size FPS(avg) mAP weights
Darknet53_spp_pan_ciou 608x608 23 62.52% yolov4.pb kvn3
Darknet53_spp_pan_ciou 512x512 29 59.77% yolov4.pb fwkc
Darknet53_spp_pan_ciou 416x416 36 55.01% yolov4.pb li3p

Environment

Python 3.6.8

Tensorflow 1.13.1


Quick Start

  1. Download YOLOv4 weights from yolov4.weights.
  2. Convert the Darknet YOLOv4 model to a tf model.
  3. Run YOLOv4 detection.

Running from_darknet_weights_to_ckpt.py will get tf yolov4 weight file yolov4_coco.ckpt.

python from_darknet_weights_to_ckpt.py

Running ckpt2pb.py will get tf yolov4 weight file yolov4.pb.

python ckpt2pb.py

Or running from_darknet_weights_to_pb.py directly.

python from_darknet_weights_to_pb.py

Usage

Inference

python image_demo.py

train

to yolov4/config.py add your own path.

python train.py

Reference

[1] Cross Stage Partial Network (CSPNet)

[2] A Self Regularized Non-Monotonic Neural Activation Function

[3] Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition

[4] Path Aggregation Network for Instance Segmentation

[5] Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression

[6] Focal Loss for Dense Object Detection

[7] When Does Label Smoothing Help?

[8] Convolutional Block Attention Module

[9] YOLOv4: Optimal Speed and Accuracy of Object Detection

[10] YOLOv3: An Incremental Improvement

[11] Aggregated Residual Transformations for Deep Neural Networks

Acknowledgment

keras_yolov3 https://github.com/qqwweee/keras-yolo3.

About

A tensorflow implementation of YOLOv4. CSPDarknet53 PAN SPP CIoU Mish,

Resources

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages