The TensorFlow 2.0 Implementation of Yolo V3 Object Detection Network

June 5, 2019, 6:58 p.m. By: Vishakha Jha

yolov3

The robust, open-source Machine learning Software library, Tensorflow today is known as the new synonym of Machine learning, and Tensorflow 2.0, was a major milestone that was achieved with its main focus on ease of use and highlights like Eager Execution, Support for more platforms and languages that improved compatibility and much more.

And here, we present to you a repository that provides a clean implementation of Yolov3 in Tensorflow 2.0 making the use of all the best practices.

Before we move on further, What is YOLO?

Talking a bit about what the system is, You Look Only Once(YOLO) is an algorithm that makes the use of Convolutional Neural Network(CNN) for object detection. And what’s great about object detection is that when compared to recognition algorithms, a detection algorithm does not only predict class labels but detects locations of objects as well.

YOLOv3 makes the use of a few tricks in order to improve training and increase performance, including: multi-scale predictions, a better backbone classifier, and a lot more.

The implementation of YoloV3 is mostly referenced from the origin paper (Has been mentioned in the end of the article), original darknet with inspirations from many existing codes written in PyTorch, Keras and TF1. The project works along with both YoloV3 and YoloV3-Tiny and is compatible with pre-trained darknet weights.

Why was this repository created?

The main reason it was created was that despite there being tons of blog posts and tutorials around TensorFlow 2.0 you wouldn't really find a complete example that makes the use of all the latest features and best practices brought by TF2.

Hence, This project has been created with the goal of not only being clean but also efficient and complete with zero legacy debts.

Now, moving onto some of the key features of the Repository:

  • Tensorflow 2.0: Everything is Tensorflow 2.0, no more session.run or import keras.backend as K

  • Follows the best practices

  • Pure functional model definition that is compatible with both Eager as well as Graph execution

  • Eager mode custom training loop with tf.GradientTape a feature that is very good for debugging.

  • Graph mode high performance training making the use of model.fit(dataset)

  • Training pipeline makes the us of tf.data and TFRecord for optimal throughput

  • Input transformations are implemented using the @tf.function auto-graph feature

  • Almost all tensor manipulations are vectorized in order to squeeze out that last bit of efficiency

  • GPU Accelerated: Works with GPU out of box (TF2's GPU integration is miles ahead of PyTorch's if gpu: x.cuda())

  • Fully integrated with absl-py from abseil.io: TensorFlow 2.0 is deprecating tf.flags and recommends abseil that is a great library heavily made use of by Google.

  • Even though, as of now, multi-gpu or distributed setup have not been tested, but they are supposedly very easy to do with Tensorflow 2.0.

  • MIT Licence

  • Clean Implementation

While the project was a great implementation, TF2, in the coming months will definitely rise following the official GA release.

Given above is just the basic regarding the repository, for more information, one can go through the links mentioned below:

Source and Information: GitHub

Link to the origin paper: Click Here