A TensorFlow 2.0 implementation of YOLOv4: Optimal Speed and Accuracy of Object Detection
MIT License
A TensorFlow 2.0 implementation of YOLOv4: Optimal Speed and Accuracy of Object Detection
This implementation runs (for now) inference with the original Darknet weights from AlexeyAB. See the roadmap section to see what's next.
To install this package, you can run:
pip install tf2_yolov4
pip install tensorflow
# Check that tf2_yolov4 is installed properly
python -c "from tf2_yolov4.model import YOLOv4; print(YOLOv4)"
Requirements:
Our YOLOv4 implementation supports the weights
argument similarly to Keras applications. To load a model with pretrained
weights, you can simply call:
# Loads Darknet weights trained on COCO
model = YOLOv4(
input_shape,
num_classes,
anchors,
weights="darknet",
)
If weights are available locally, they will be used. Otherwise, they will be automatically downloaded.