Skip to main content

YOLOv3 implementation in TensorFlow 2.x

Project description

CI

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


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.8.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

yolov3_tf-0.1.8-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file yolov3-tf-0.1.8.tar.gz.

File metadata

  • Download URL: yolov3-tf-0.1.8.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.13 Linux/5.15.0-1019-azure

File hashes

Hashes for yolov3-tf-0.1.8.tar.gz
Algorithm Hash digest
SHA256 61472a11154704c2f3a76c75d7e1689ee8bd76ac6696aed67e3b816449266e3b
MD5 3d27d9f930993de607438be6e0e73a01
BLAKE2b-256 4ccf8e975f4cde824a929968c401cb64d2241bd31be132138caac7c58a02a07d

See more details on using hashes here.

File details

Details for the file yolov3_tf-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: yolov3_tf-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.13 Linux/5.15.0-1019-azure

File hashes

Hashes for yolov3_tf-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7fba37733c1c14b676e21fc81e6c73ad8c73c7561455a28da01a3c452a3278
MD5 4bae5a51728bf6976f6cfcdcd259c254
BLAKE2b-256 4433dd0a8eb19647432c5fda54b429c93cdfa26df945cef37cbac78a5ab64981

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page