AI could be as easy as opening a file and one click of "run all"!
We present a quickly accessible Object Detection module for all newbies without AI knowledge. YOLOv4 is the state-of-the-art Object Detection algorithm applicable to mobile devices. Our Tensorflow implementation is ready for use with pretrained weights (the original Darknet weights from AlexeyAB). It has minimal code and easy to follow.
Once you get comfortble with the module, you can either choose to extend the functionality by combineing with other modules, such as OCR (Optical Character Recognition), Object Tracking, Object Counting, Object Detection in Webcam, etc., check out theAIGuysCode for inspirations. Or you can choose to customize the configuration parameters, migrate to TensorFlow Lite for mobile devices, fine-tune weights for your domain, or even transfer learning for other purpose, check out hunglc007 / tensorflow-yolov4-tflite for inspirations.
core
|________config.py Configuration for YOLOv4
|________utils.py Utilities for YOLOv4
data
|________classes
| |________coco.names List of object types for YOLOv4
|________kite.jpg Example image
|________road.mp4 Example video
yolov4-416 Pretrained weights
detectimage.py Object detection for image
detectvideo.py Object detection for video
requirements-cpu.txt Requirements for running with CPU
requirements-gpu.txt Requirements for running with GPU
result.png Example output image
results.avi Example output video
Object-Detection-With-YOLOv4-TF.ipynb
- Tensorflow 2.3.0rc0
pip install -r requirements-gpu.txt
or
pip install -r requirements-cpu.txt
# Go to the directory containing weights
cd /content/Object-Detection-With-YOLOv4-TF/yolov4-416/variables/
# Concatenate the zip parts into a whole one
cat variables.z* > variables-all.zip
# Unzip for the weights
unzip variables-all.zip
# Object detection in images
python detectimage.py --image ./data/kite.jpg --output result.png
# Object detection in videos
python detectvideo.py --video ./data/road.mp4 --output result.avi
- Supply the demo for running in cloud (Colab)
- Add results for illustration
- Supply the code map
- YOLOv4: Optimal Speed and Accuracy of Object Detection YOLOv4.
My project is based on these previous fantastic YOLOv4 implementations: