0

I am using detecto and a training model I created to identify an object. When I use it on a picture, it works just fine. When I try to use a video and detect an object I get this error.

Exception has occurred: error
OpenCV(4.5.3) :-1: error: (-5:Bad argument) in function 'rectangle'
> Overload resolution failed:
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'pt1'. Sequence item with index 0 has a wrong type
>  - Can't parse 'rec'. Expected sequence length 4, got 2
>  - Can't parse 'rec'. Expected sequence length 4, got 2
  File "S:\Desktop\Random\PyHacks\frames\traindata.py", line 20, in <module>
    visualize.detect_video(model, 'frames/atest1.mp4', 'output.avi')

This is the code that I am running.

from detecto import core, utils, visualize

model = core.Model.load('model_weights.pth', ['player'])
visualize.detect_video(model, 'frames/atest1.mp4', 'output.avi')
apknusel
  • 11
  • 6
  • you should ask the author of the module. – Christoph Rackwitz Aug 28 '21 at 14:59
  • 1
    Does this answer your question? [(-5:Bad argument) in function 'rectangle' - Can't parse 'pt1'. Sequence item with index 0 has a wrong type](https://stackoverflow.com/questions/67921192/5bad-argument-in-function-rectangle-cant-parse-pt1-sequence-item-wit) – Christoph Rackwitz Mar 11 '22 at 11:20

0 Answers0