-
Notifications
You must be signed in to change notification settings - Fork 126
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
'str' object has no attribute 'shape' #52
Comments
You need to read the image before passing it to
Checkout this complete example. |
As i try that, i get the second error: |
Make sure that you are giving the correct path to the input image while reading using
Checkout this Colab notebook to learn more. |
Still the same error ... |
Can you share the complete code and input image you are using ? Let me try to reproduce this error on my end for debugging. Please share the version of OpenCV, cvlib and Python as well. |
python version = 3.10.8 `import cvlib as cv image = cv2.imread(sys.argv[1]) bbox, label, conf = cv.detect_common_objects(image) out = draw_bbox(image, bbox, label, conf) cv2.imshow("object_detection", out) cv2.imwrite("object_detection.jpg", out) cv2.destroyAllWindows()` |
What command are you using to run the code ? |
python E:\SR4E1\test-object-detectie1.py E:\SR4E1\imeges\object_detection_input.jpg (on Windows 10) |
It seems that there is issue in reading the image. Are you sure the path to the input image is correct ? |
That is a typo. The folder name is |
Can you try running the command from the
|
Still the same error ... |
As i convert the images to PNG it's work! Thank you for helping me. (and for the easy to use libarty) |
When I try to use a function, do i get the error:
Traceback (most recent call last):
File "E:/python/test-object-detectie1.py", line 4, in
bbox, label, conf = cv.detect_common_objects('object_detection_input.jpg')
File "C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\site-packages\cvlib\object_detection.py", line 77, in detect_common_objects
Height, Width = image.shape[:2]
AttributeError: 'str' object has no attribute 'shape'
Can someone help me?
The text was updated successfully, but these errors were encountered: