Skip to content

Latest commit

 

History

History
130 lines (82 loc) · 3.01 KB

README.md

File metadata and controls

130 lines (82 loc) · 3.01 KB

license pypi language

tensorflow-yolov4

python3 -m pip install yolov4

YOLOv4 Implemented in Tensorflow 2.

Download Weights

Dependencies

python3 -m pip install -U pip setuptools wheel
python3 -m pip install numpy

Install OpenCV (cv2)

Tensorflow 2

python3 -m pip install tensorflow

TFlite

Ref: https://www.tensorflow.org/lite/guide/python

Objective

  • Train and predict using TensorFlow 2 only
  • Run yolov4-tiny-relu on Coral board(TPU).
  • Train tiny-relu with coco 2017 dataset
  • Update Docs
  • Optimize model and operations

Performance

performance

performance-tiny

Help

>>> from yolov4.tf import YOLOv4
>>> help(YOLOv4)

Inference

tensorflow

from yolov4.tf import YOLOv4

yolo = YOLOv4()

yolo.classes = "coco.names"

yolo.make_model()
yolo.load_weights("yolov4.weights", weights_type="yolo")

yolo.inference(media_path="kite.jpg")

yolo.inference(media_path="road.mp4", is_image=False)

Object detection test jupyter notebook

from yolov4.tf import YOLOv4

yolo = YOLOv4(tiny=True)

yolo.classes = "coco.names"

yolo.make_model()
yolo.load_weights("yolov4-tiny.weights", weights_type="yolo")

yolo.inference(media_path="kite.jpg")

yolo.inference(media_path="road.mp4", is_image=False)

tensorflow lite

from yolov4.tf import YOLOv4

yolo = YOLOv4()

yolo.classes = "coco.names"

yolo.make_model()
yolo.load_weights("yolov4.weights", weights_type="yolo")

yolo.save_as_tflite("yolov4.tflite")
from yolov4.tflite import YOLOv4

yolo = YOLOv4()

yolo.classes = "coco.names"

yolo.load_tflite("yolov4.tflite")

yolo.inference("kite.jpg")

Training

https://wiki.loliot.net/docs/etc/project/yolov4/yolov4-training