import cv2
import matplotlib.pyplot as plt
import cvlib as cv
from cvlib.object_detection import draw_bbox
import tensorflow
load_p = cv2.imread('C:/Users/path/file.jpg')
bbox, label, conf = cv.detect_common_objects(load_p)
img_out= draw_bbox(im, bbox, label, conf)
plt.imshow(img_out)
plt.show()
This is my code and once I plot the image, it does seem to work since it colors/shades the whole object in blue. However, there are no square/boxes around the object neither labels nor confidence intervals. I have no errors while loading the packages even though I had it before, un-installing everything made it work again.
Any ideas what could be the potential problem of not giving me the coordinates in the list of bbox
, label
and conf
? Which are supposed to store the coordinates of the boxes that label the object.
btw:
Once I create a variable as stated above(img_out= draw_bbox(im, bbox, label, conf)
)
these are its values until 2199. Does it maybe have to do with reshaping the image before handing into the function object_detection?