yolov3-tf2  by zzh8829

YOLOv3 object detection implemented in TensorFlow 2.0

Created 7 years ago
2,513 stars

Top 18.2% on SourcePulse

GitHubView on GitHub
Project Summary

This repository offers a clean, best-practice implementation of the YOLOv3 object detection model in TensorFlow 2.0. It caters to engineers and researchers seeking a robust and flexible framework for object detection tasks, providing pre-trained weights, inference examples, and comprehensive training capabilities. The project aims to deliver a high-quality, well-structured codebase that is both performant and easy to adapt.

How It Works

The implementation leverages TensorFlow 2.0's features, supporting both eager execution with tf.GradientTape for flexibility and graph execution via model.fit for performance. It utilizes a functional Keras model built with tf.keras.layers, an efficient input pipeline powered by tf.data, and vectorized transformations for accelerated processing. GPU acceleration is fully supported, and the project is integrated with absl-py for standardized application interfaces, reflecting Google's best practices for large-scale applications.

Quick Start & Requirements

Installation is recommended via Conda using provided conda-cpu.yml or conda-gpu.yml files, or via Pip with requirements.txt. A compatible Nvidia Driver is required for GPU acceleration. Pre-trained Darknet weights can be converted using convert.py. Detection can be run on images (detect.py), videos (detect_video.py), or webcam streams. A detailed tutorial for training from scratch on the VOC2012 dataset is available at https://github.com/zzh8829/yolov3-tf2/blob/master/docs/training_voc.md. The model can also be exported for TensorFlow Serving.

Highlighted Details

  • Supports both YOLOv3 and YOLOv3-tiny architectures with pre-trained weights.
  • Provides examples for inference and transfer learning.
  • Offers flexible training modes: eager execution, model.fit, and custom GradientTape loops.
  • Includes performance benchmarks demonstrating comparable speeds to the original Darknet implementation across various hardware.
  • Facilitates model export to TensorFlow Serving format.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or active development signals were present in the provided README.

Licensing & Compatibility

The project is released under the MIT License, which permits commercial use and integration into closed-source projects.

Limitations & Caveats

Eager execution, while flexible, may present a steeper learning curve for those unfamiliar with TensorFlow's nuances, particularly concerning control flow that can break graph compilation. The tf.keras.layers.BatchNormalization layer may require specific adjustments for optimal transfer learning performance with small batch sizes. Users may encounter NAN loss or training convergence issues, often linked to learning rate settings, input data formatting, or incorrect label visualization.

Health Check
Last Commit

2 years ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.