Skip to content

Instantly share code, notes, and snippets.

@sabiipoks
Created November 26, 2022 08:22
Show Gist options
  • Save sabiipoks/e80ea2634a8469d4152ee7ebb0bb65ce to your computer and use it in GitHub Desktop.
Save sabiipoks/e80ea2634a8469d4152ee7ebb0bb65ce to your computer and use it in GitHub Desktop.
Object detection python
import cv2
import matplotlib.pyplot as plt
import cvlib as cv
from cvlib.object_detection import draw_bbox
im = cv2.imread('apple-256261_640.jpg')
bbox, label, conf = cv.detect_common_objects(im)
output_image = draw_bbox(im, bbox, label, conf)
plt.imshow(output_image)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment