0

I am trying to replicate a simple object detection that I found in on website.

import cv2
import matplotlib.pyplot as plt
import cvlib as cv
from cvlib.object_detection import draw_bbox

im = cv2.imread('downloads.jpeg')
bbox, label, conf = cv.detect_common_objects(im)
output_image = draw_bbox(im, bbox, label, conf)
plt.imshow(output_image)
plt.show()

All required libraries are installed and there are no errors running the code. However, it does not show the output image with the boxes, labels and confidence. How do I fix it?

Output image

1 Answers1

0
#After loading an image use an assert:
img = cv2.imread('downloads.jpeg')

assert not isinstance(img,type(None)), 'image not found'
chrslg
  • 9,023
  • 5
  • 17
  • 31
Xolani
  • 1
  • 2