Comments (13)
You need to read the image before passing it to detect_common_objects
function.
# read input image
image = cv2.imread('object_detection_input.jpg')
# apply object detection
bbox, label, conf = cv.detect_common_objects(image)
Checkout this complete example.
from cvlib.
As i try that, i get the second error:Traceback (most recent call last): File "G:\SR4E1\test-object-detectie1.py", line 12, in <module> bbox, label, conf = cv.detect_common_objects(image) File "C:\Users\philippechristl\AppData\Local\Programs\Python\Python310\lib\site-packages\cvlib\object_detection.py", line 77, in detect_common_objects Height, Width = image.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'
from cvlib.
Make sure that you are giving the correct path to the input image while reading using cv2.imread
. Try giving the complete path to the image. For example, if the image is in SR4E1
folder, try using the path as below.
image = cv2.imread('G:\SR4E1\object_detection_input.jpg')
Checkout this Colab notebook to learn more.
from cvlib.
Still the same error ...
from cvlib.
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.
from cvlib.
python version = 3.10.8
cvlib version = 0.2.7
OpenCV version = 1.0.0
image = https://github.com/arunponnusamy/cvlib/blob/master/examples/images/object_detection_input.jpg
`import cvlib as cv
from cvlib.object_detection import draw_bbox
import sys
import cv2
image = cv2.imread(sys.argv[1])
bbox, label, conf = cv.detect_common_objects(image)
print(bbox, label, conf)
out = draw_bbox(image, bbox, label, conf)
cv2.imshow("object_detection", out)
cv2.waitKey()
cv2.imwrite("object_detection.jpg", out)
cv2.destroyAllWindows()`
from cvlib.
What command are you using to run the code ?
from cvlib.
python E:\SR4E1\test-object-detectie1.py E:\SR4E1\imeges\object_detection_input.jpg (on Windows 10)
from cvlib.
It seems that there is issue in reading the image. Are you sure the path to the input image is correct ?
The folder name is images
or imeges
? Is that a typo ?
from cvlib.
That is a typo. The folder name is images
from cvlib.
Can you try running the command from the SR4E1
folder ?
cd E:\SR4E1\
python test-object-detectie1.py E:\SR4E1\images\object_detection_input.jpg
from cvlib.
Still the same error ...
from cvlib.
As i convert the images to PNG it's work! Thank you for helping me. (and for the easy to use libarty)
from cvlib.
Related Issues (20)
- object Detection color HOT 2
- is there anyway i can detect house in the image HOT 1
- The 'cvlib' distribution was not found and is required by the application in PyInstaller HOT 2
- What dataset have you used to make face detector part of this model? HOT 1
- Count objects detected using cvlib HOT 2
- ModuleNotFoundError HOT 3
- draw_bbox() Line size is fixed at a value of 2 pixels HOT 1
- No face detected in image HOT 1
- The recognition rate of pictures taken by wide-angle lens is low
- yolov4 HOT 4
- Invalid bounding boxes returned occasionally HOT 1
- Is there a way of using face recognition?
- How to add text as object to be detected
- Live Face Detect
- Unable to execute object_detection HOT 7
- library not working
- About Error invalid index to scalar variable in object_detection.py HOT 1
- Add requirements.txt
- This module is officially broken now with any of the latest python versions, eg python version higher than 3.9 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cvlib.