Created
July 13, 2021 00:06
-
-
Save shoaibmehedi7/5fad278829680497b69497c75ecef0cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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