Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cap = cv2.VideoCapture(-1)
- while(True):
- ret, frame = cap.read()
- if not ret:
- raise ValueError("unable to load Image")
- img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
- im_pil = Image.fromarray(img)
- coord = model(transform(im_pil))
- frame = cv2.rectangle(frame, (coord[0], coord[1]), (coord[2], coord[3]), (0, 0, 255))
- cv2.imshow(frame)
- cap.release()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement