YOLO - You Look Only Once
Drive Link = https://drive.google.com/drive/u/0/folders/1USa7N0JCIeGGhZhkKP18-QuziOzh8riX
Code:
import cv2
import matplotlib.pyplot as plt
import numpy as np
import cvlib as cv # pip install cvlib
from cvlib.object_detection import draw_bbox
im = cv2.imread(r'p2.jpeg')
plt.imshow(im[:,:,::-1])
bbox , conf = cv.detect_face(im)
bbox
conf
labels = []
for i in range(len(conf)):
labels.append('person')
im2 = draw_bbox(im,bbox,labels,conf)
plt.imshow(im2[:,:,::-1])
im = cv2.imread(r'a.jpg')
bbox , labels, conf = cv.detect_common_objects(im)
im2 = draw_bbox(im,bbox,labels,conf)
plt.imshow(im2[:,:,::-1])
labels
Comments
Post a Comment