YOLOv3 implementation in TensorFlow 2.x
Project description
YOLOv3-TF
YOLOv3 implementation in TensorFlow 2.x
Installation
pip install yolov3-tf
Depends on tensorflow >=2.3.0 <=2.9.1
Usage
The package consists of three core modules -
- dataset
- models
- utils
Dataset
The dataset.py
module is for loading and transforming the tfrecords for object detection. The examples in the input tfrecords must match the parsing schema.
import yolov3_tf.dataset as dataset
train_dataset = dataset.load_tfrecord_dataset(tfrecords_path)
train_dataset = train_dataset.batch(batch_size)
train_dataset = train_dataset.map(
lambda x, y: (
dataset.transform_images(x, image_dim),
dataset.transform_targets(y, anchors, anchor_masks, image_dim),
)
)
Models
The models.py
module consists of implementation of two YOLOv3 and YOLOv3 tiny in Tesnsorflow.
from yolov3_tf.models import YoloV3, YoloV3Tiny
model = YoloV3(image_dim = 416, training=True, classes=10)
Utils
The utils.py
module provides some common functions for training YOLOv3 model, viz., loading weights, freezing layers, drawing boxes on images, compute iou
# convert weights
from yolov3_tf.models import YoloV3, YoloV3Tiny
from yolov3_tf import utils
yolo = YoloV3()
utils.load_darknet_weights(yolo, weights_path, is_tiny=False)
yolo.save_weights(converted_weights_path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yolov3-tf-0.1.0.tar.gz
(9.4 kB
view hashes)
Built Distribution
yolov3_tf-0.1.0-py3-none-any.whl
(10.2 kB
view hashes)
Close
Hashes for yolov3_tf-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f53fa42c932d32c6015f68b2eae89344eb932a0a6358e55c2256ac6fcc7a340 |
|
MD5 | c564a57b9af28bd1549bc2f67617f121 |
|
BLAKE2b-256 | 36b0b4390c481ee73eda31e81bcdefe8e59139a74aa65c9d55a75aea1c9e678b |