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')