gitmyhub

keras-yolo3

Python ★ 7.1k updated 3y ago

A Keras implementation of YOLOv3 (Tensorflow backend)

keras-yolo3 is a Keras and TensorFlow implementation of YOLOv3 object detection that lets you run a pre-trained model on images and videos, or train your own detector on custom object categories.

PythonKerasTensorFlowYOLOsetup: hardcomplexity 4/5

keras-yolo3 is a Python implementation of YOLOv3, a system for detecting and locating objects in images and videos. YOLO stands for You Only Look Once, referring to how the model processes an entire image in a single pass to identify where objects are and what they are. This implementation is built on top of Keras, a Python library for working with neural networks, using TensorFlow as the underlying computation engine.

To get started, you download the official YOLOv3 weights file from the original YOLO project website, then run a conversion script included in this repository to translate those weights into a format Keras can read. After that, you can run detection on a single image or on a video file using the provided script. The script supports multiple GPUs if you have more than one available, and there is also a smaller, faster variant called Tiny YOLOv3 for cases where speed matters more than accuracy.

If you want to train the model on your own categories of objects rather than the default 80 classes, you prepare an annotation file that lists each image path alongside the bounding box coordinates and class labels for every object in that image. You then run the training script, which first freezes the early layers of the network and only trains the final layers, a common approach that saves time and works well when starting from pretrained weights. A separate script handles the bottleneck feature approach, which pre-computes intermediate outputs so that training is feasible even on a machine with only a CPU.

The README notes that results differ slightly from the original Darknet implementation, that inference is somewhat slower, and that the training approach shown is a starting point rather than a definitive recipe. The project was tested with Python 3.5, Keras 2.1.5, and TensorFlow 1.6, which are older versions, so compatibility with newer software may require adjustments.

Where it fits