0
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?

enter image description here

Cena
  • 3,316
  • 2
  • 17
  • 34
Ecko
  • 115
  • 9

1 Answers1

0

The above code does work properly I just tried on the same image that another guy was using it on and it does label and draws boxes.

My question is, obviously it doesn't recognize the typical objects that are from Yolo database, either way, it does seem to detect the objects that I'm looking for in the image. (but without boxes and labels)

From here is it suggested to find a workaround to get the coordinates or find another more suitable approach this my problem.

Example of my type of problem with a different picture: (no coordinates in the list, but seems to detect the object)

enter image description here

The one that works properly and has coordinates stored in the list. enter image description here

I don't care about the label, what I do care about is to find all the objects in the image.

Ecko
  • 115
  • 9