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 5 - Made Changes to following lines in code
Sample Example Code
Yolo on Colab - Link
Happy Learning!!!
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |