YOLOv4 implementation with Tensorflow 2
Project description
tf-yolov4
YOLOv4 implementation with Tensorflow 2.
Install
pip instal tf-yolov4
Example
Prediction
import numpy as np
import PIL.Image
import yolov4
# Default: num_classes=80
yo = yolov4.YOLOv4(num_classes=80)
# Default: weights_path=None
# num_classes=80 and weights_path=None: Pre-trained COCO model will be loaded.
# num_classes!=80 and weights_path=None: Pre-trained backbone and SPP model will be loaded.
# Otherwise: User-defined weight file will be loaded.
yo.load_weights(weights_path=None)
img = np.array(PIL.Image.open('./data/sf.jpg'))
# The image with predicted bounding-boxes is created if `debug=True`
boxes, classes, scores = yo.predict(img, debug=True)
Load Darknet weight
import yolov4
yo = yolov4.YOLOv4(num_classes=10)
yo.load_darknet_weights('/path/to/darknet_weight')
TODO
- Prediction
- Load Darknet weight file
- Pre-trained model
- Basic training function and Loss definition
- Label-smoothed BCE loss
- c-IoU loss
- Training data augmentation
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
tf-yolov4-1.0.2.tar.gz
(10.6 kB
view hashes)
Built Distribution
tf_yolov4-1.0.2-py3-none-any.whl
(21.8 kB
view hashes)
Close
Hashes for tf_yolov4-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b8c100db113f3cac581fa55d3ceecb705d94c936fa940400ee44070ae720528 |
|
MD5 | 04df8407f4493ec2f9a4e0b360bc2e21 |
|
BLAKE2b-256 | f1503152aaa1f8a95d3ab1ba1ef89ea2b57581252b66e1d7d3937171cd77cac5 |