Created
July 10, 2018 08:31
-
-
Save dkurt/73348a807d2bfff3ee7b6fb072305e5e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 as cv | |
import numpy as np | |
img = cv.imread('/home/dkurt/Pictures/download.jpeg') | |
inp = cv.dnn.blobFromImage(img, 0.017, (224, 224), (103.94,116.78,123.68), swapRB=False, crop=False) | |
net = cv.dnn.readNet('shufflenet_1x_g3_deploy.prototxt', 'shufflenet_1x_g3.caffemodel') | |
net.setPreferableBackend(cv.dnn.DNN_BACKEND_OPENCV) | |
net.setInput(inp) | |
out = net.forward() | |
print np.argmax(out), np.max(out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment