/tensorflow-MobilenetV2-YOLOv1

An implementation of YOLOv1 for object detection in TensorFlow.

Primary LanguagePython

Object Detection

This is the implementation of YOLOv1 for object detection in Tensorflow. It contains complete code for preprocessing, training and test. Besides, this repository is easy-to-use and can be developed on Linux and Windows.

YOLOv1 : Redmon, Joseph, et al. "You only look once: Unified, real-time object detection." Proceedings of the IEEE conference on computer vision and pattern recognition. 2016.

Getting Started

1 Prerequisites

  • Python3.6
  • Tensorflow
  • Opencv-python
  • Pandas

2 Define your class names

Download and unzip this repository.
cd ../YOLOv1/label
Open the label.txt and revise its class names as yours.

3 Prepare images

Copy your images and annotation files to directories ../YOLOv1/data/annotation/images and ../YOLOv1/data/annotation/images/xml respectively, where the annotations should be obtained by a graphical image annotation tool and saved as XML files in PASCAL VOC format.
cd ../YOLOv1/code
run python spilt.py
Then train and val images will be generated in ../YOLOv1/data/annotation/train and /YOLOv1/data/annotation/test directories, respectively.

4 Train model using Tensorflow

The model parameters, training parameters and eval parameters are all defined by parameters.py.
cd ../YOLOv1/code
run python train.py
The model will be saved in directory ../YOLOv1/model/checkpoint, and some detection results are saved in ../YOLOv1/pic.

5 Visualize model using Tensorboard

cd ../YOLOv1
run tensorboard --logdir=model/
Open the URL in browser to visualize model.

Examples

Here are two successful detection examples in my dataset:

Image Image