Yolo v3 is an algorithm that uses deep convolutional neural networks to detect objects.
This project is written in Python 3.6.6 using Tensorflow (deep learning), NumPy (numerical computing), Pillow (image processing), OpenCV (computer vision) and seaborn (visualization) packages. I will be using anaconda to install all the library.
conda env create -f enviroment.yaml
Let's download official weights pretrained on COCO dataset.
!wget -P weights https://pjreddie.com/media/files/yolov3.weights
Save the weights using load_weights.py
script.
python load_weights.py
Now you can run the model using detect.py
script. Don't forget to set the IoU (Intersection over Union) and confidence thresholds.
python detect.py <images/video> <iou threshold> <confidence threshold> <filenames>
Let's run an example using sample images.
python detect.py images 0.5 0.5 data/images/bali_street.jpg
Then you can find the detections in the detections
folder.
python detect.py video 0.5 0.5 data/video/Street.mp4
The detections will be saved as detections.mp4
file.
- Model training in GPU