"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

June 30, 2018

Day #117 - Yolo Object Detection

This post is using Yolo for object detection

Step 1 - Download Repo - https://github.com/thtrieu/darkflow
Step 2 - Install Commands - https://github.com/markjay4k/YOLO-series/blob/master/part1%20-%20setup%20YOLO.ipynb

Step 3 - Install Cython
Step 4 - Build Downloaded Code


Step 5 - Made Changes to following lines in code



Sample Example Code

Yolo on Colab - Link

import cv2
import sys
sys.path.append("E:\\darkflow-master\\darkflow-master\\")
from darkflow.net.build import TFNet
import matplotlib.pyplot as plt
options = {
'model': 'E:\\RNotes\\darkflow-master\\cfg\\yolo.cfg',
'load': 'E:\\RNotes\\darkflow-master\\bin\\yolov2.weights',
'threshold': 0.14,
'gpu': 1.0
}
tfnet = TFNet(options)
img = cv2.imread('E:\\yolo\\Test.jpeg', cv2.IMREAD_COLOR)
#img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# use YOLO to predict the image
result = tfnet.return_predict(img)
print(result)
print(img.shape)
view raw yolo.py hosted with ❤ by GitHub
Happy Learning!!!

No comments: