Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. cap = cv2.VideoCapture(-1)
  2. while(True):
  3. ret, frame = cap.read()
  4. if not ret:
  5. raise ValueError("unable to load Image")
  6. img = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
  7. im_pil = Image.fromarray(img)
  8. coord = model(transform(im_pil))
  9. frame = cv2.rectangle(frame, (coord[0], coord[1]), (coord[2], coord[3]), (0, 0, 255))
  10. cv2.imshow(frame)
  11. cap.release()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement