Commit 8ac2c5d6 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #9796 from lzx1413:patch-1

parents 2c1b4f57 9661d60f
...@@ -11,7 +11,7 @@ def get_class_list(): ...@@ -11,7 +11,7 @@ def get_class_list():
with open('synset_words.txt', 'rt') as f: with open('synset_words.txt', 'rt') as f:
return [x[x.find(" ") + 1:] for x in f] return [x[x.find(" ") + 1:] for x in f]
blob = dnn.blobFromImage(cv2.imread('space_shuttle.jpg'), 1, (224, 224), (104, 117, 123), false) blob = dnn.blobFromImage(cv2.imread('space_shuttle.jpg'), 1, (224, 224), (104, 117, 123), False)
print("Input:", blob.shape, blob.dtype) print("Input:", blob.shape, blob.dtype)
net = dnn.readNetFromCaffe('bvlc_googlenet.prototxt', 'bvlc_googlenet.caffemodel') net = dnn.readNetFromCaffe('bvlc_googlenet.prototxt', 'bvlc_googlenet.caffemodel')
......
...@@ -41,7 +41,7 @@ if __name__ == "__main__": ...@@ -41,7 +41,7 @@ if __name__ == "__main__":
while True: while True:
# Capture frame-by-frame # Capture frame-by-frame
ret, frame = cap.read() ret, frame = cap.read()
blob = cv.dnn.blobFromImage(frame, inScaleFactor, (inWidth, inHeight), meanVal, false) blob = cv.dnn.blobFromImage(frame, inScaleFactor, (inWidth, inHeight), meanVal, False)
net.setInput(blob) net.setInput(blob)
detections = net.forward() detections = net.forward()
......
...@@ -27,7 +27,7 @@ if __name__ == '__main__': ...@@ -27,7 +27,7 @@ if __name__ == '__main__':
cols = frame.shape[1] cols = frame.shape[1]
rows = frame.shape[0] rows = frame.shape[0]
net.setInput(dnn.blobFromImage(frame, 1.0, (inWidth, inHeight), (104.0, 177.0, 123.0), false)) net.setInput(dnn.blobFromImage(frame, 1.0, (inWidth, inHeight), (104.0, 177.0, 123.0), False))
detections = net.forward() detections = net.forward()
perf_stats = net.getPerfProfile() perf_stats = net.getPerfProfile()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment