Ask Your Question

Revision history [back]

Hi Christof,

Yes, I had to tweak the code a bit to get the answer. Firstly, the code in the tutorial is updated in the actual repository. So the command line changed to this -

python classification.py --model=bvlc_googlenet.caffemodel --config=bvlc_googlenet.prototxt --width=224 --height=224 --classes=classification_classes_ILSVRC2012.txt --input=sample.jpg

Also, I used matplotli to get the result, because cv.namedWindow(winName, cv.WINDOW_NORMAL), wasn't working on my system, and a few answers on StackOverflow don't recommend using it either. So, I am using the following -

import matplotlib.pyplot as plt plt.imshow(frame) plt.show(block=True)

I am also having trouble with the waitkey function. So, I mostly need to reinstall a few things. Hope this helps.

Hi Christof,

Yes, I had to tweak the code a bit to get the answer. Firstly, the code in the tutorial is updated in the actual repository. So the command line changed to this -

python classification.py --model=bvlc_googlenet.caffemodel --config=bvlc_googlenet.prototxt --width=224 --height=224 --classes=classification_classes_ILSVRC2012.txt --input=sample.jpg

--input=sample.jpg

Also, I used matplotli matplotlib to get the result, because cv.namedWindow(winName, cv.WINDOW_NORMAL), wasn't working on my system, and a few answers on StackOverflow don't recommend using it either. So, I am using the following -

import matplotlib.pyplot as plt
plt.imshow(frame)
plt.show(block=True)

plt.show(block=True)

I am also having trouble with the waitkey function. So, I mostly need to reinstall a few things. Hope this helps.

Hi Christof,

Yes, I had to tweak the code a bit to get the answer. Firstly, the code in the tutorial is updated in the actual repository. This is my reference code - classification.py

So the command line changed changes to this -

python classification.py --model=bvlc_googlenet.caffemodel --config=bvlc_googlenet.prototxt --width=224 --height=224 --classes=classification_classes_ILSVRC2012.txt --input=sample.jpg

Instead of this -

python classification.py  --model=bvlc_googlenet.caffemodel --config=bvlc_googlenet.prototxt --width=224 --height=224 --classes=classification_classes_ILSVRC2012.txt --input=space_shuttle.jpg --mean="104 117 123"

Also, I used matplotlib to get the result, because cv.namedWindow(winName, cv.WINDOW_NORMAL), wasn't working on my system, and a few answers on StackOverflow don't recommend using it either. So, I am using the following -

import matplotlib.pyplot as plt
plt.imshow(frame)
plt.show(block=True)

I am also having trouble with the waitkey function. So, I mostly need to reinstall a few things. Hope this helps.