-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: invalid index to scalar variable. (CaptureReferenceImage.py) #6
Comments
You need to install the 4.5.3.56 version of opencv python. Try this.
|
After installing it, it worked well, thank you very much. |
When I run this code, I get a new error #Collecting opencv-contrib-python==4.5.3.56 × pip subprocess to install build dependencies did not run successfully.
proceeding with generating Cython sources and expanding templates
by setting
note: This error originates from a subprocess, and is likely not a problem with pip. × pip subprocess to install build dependencies did not run successfully. Can you please help me with it. |
I'm having the same issue, have you solved it? @FareedUllah09 |
I just removed the [0] @hfatima08 as such class_names[classid], score) |
This is worked for me :) |
Thanks @callmesora |
[ WARN:0] global D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\dnn.cpp (1447) cv::dnn::dnn4_v20211004::Net::Impl::setUpNet DNN module was not built with CUDA backend; switching to CPU
Traceback (most recent call last):
File "CaptureReferenceImage.py", line 49, in
ObjectDetector(frame)
File "CaptureReferenceImage.py", line 36, in ObjectDetector
label = "%s : %f" % (class_names[classid[0]], score)
IndexError: invalid index to scalar variable.
[ WARN:0] global D:\a\opencv-python\opencv-python\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
The text was updated successfully, but these errors were encountered: