smalldroid / yolov3-keras

YOLOv3 implementation in Keras

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YOLOv3 in Keras

license

Introduction

This is my Keras implementation of YOLOv3 (Tensorflow backend) that is based on qqwweee/keras-yolo3. So far I have only implemented detection. I am working on the code for training. My goal is to have an elegant implementation of YOLOv3 in Keras for my upcoming undergraduate course on Artificial Intelligence in Fall 2019.

I have made several improvements:

  • I have written a Lambda layer for decoding the output produced by the YOLOv3 model (it is no longer necessary to run a tensorflow session as in qqwweee's implementation).
  • I have also implemented a (fast) non-maximum-suppression based on jrosebr1/imutils. To speed-up nms, I drop boxes with lower confidence and exit as soon as maximum number of boxes obtained.
  • I use opencv instead of PIL.
  • I have used tensor names that are as close as possible to the names used in the paper YOLOv3: An Incremental Improvement. Compare section 2.1 Bounding Box Prediction/Figure 2 and the implementation of the function make_decoder_layer in yolov3\model.py.

Quick start

  • Download YOLOv3 weights yolov3.weights from YOLO website.
  • Convert the Darknet YOLOv3 model to a Keras model: python convert.py yolov3.cfg yolov3.weights model_data/yolov3.h5
  • Run YOLOv3 detection: python detection.py --image <path to image> or python detection.py --video <path to video>. (Note that it takes a while to load the Keras model model_data\yolov3.h5 before the detection starts.)

Click on the image below to see this implementation in action: YOLOv3 object detection applied to ArmA3

About

YOLOv3 implementation in Keras


Languages

Language:Python 100.0%