Skip to content

Instantly share code, notes, and snippets.

@shoaibmehedi7
Created July 13, 2021 00:06
Show Gist options
  • Save shoaibmehedi7/5fad278829680497b69497c75ecef0cb to your computer and use it in GitHub Desktop.
Save shoaibmehedi7/5fad278829680497b69497c75ecef0cb to your computer and use it in GitHub Desktop.
while True: #
success, img = cap.read() #
classIds, confs, bbox = net.detect(img, confThreshold=0.5)
print(classIds, bbox)
if len(classIds) != 0: #
for classId, confidence, box in zip(classIds.flatten(), confs.flatten(), bbox):
cv2.rectangle(img, box, color=(0, 255, 0), thickness=2)
cv2.putText(img, classNames[classId-1].upper(), (box[0]+10, box[1]+30), cv2.FONT_HERSHEY_COMPLEX, 1, (0,255,0), 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment