amazon-science / siam-mot

SiamMOT: Siamese Multi-Object Tracking
Apache License 2.0
478 stars 61 forks source link

why need video in demos/demo_vis? #3

Closed Lin1225 closed 3 years ago

Lin1225 commented 3 years ago

Hi everyone, I am new to learning cv and deep learning, and I use colab as my machine. My input video is person_car.mp4, and the output video should be in demos/demo_vis, but when I run demo.py, it needs person_car.mp4 in demos/demo_vis too, that is strange. Can somebody explain? image this is my github which store my colab file

bingshuai2019 commented 3 years ago

This happens because of these lines: https://github.com/amazon-research/siam-mot/blob/main/demos/utils/vis_writer.py#L52-L53

The video writer writes down a large temporary file to demos/demo_vis/person_car.mp4 (tracking outputs have been rendered to original video), then it is replaced with the compressed video. If the demo runs through correctly, the file with the path demos/demo_vis/person_car.mp4 would be automatically generated. You should check whether the codes run it correctly.

If you have issue generating videos, you can try to use the setting --dump-video False, it will dump every frame of the video.

usbhub commented 3 years ago

You might want to try the suggestion here: https://github.com/amazon-research/siam-mot/issues/4#issuecomment-850837067 , could be related to the codec used by opencv causing a video to not be created.

If that doesn't help could you please check if there are any other errors before those you posted? Because that actually happens at the very end of the demo here: https://github.com/amazon-research/siam-mot/blob/f5800e3b1d5cfd48f9e152f0af40dbfaa3191ed0/demos/demo.py#L47 , so it should only happen if something else in the demo broke and caused it to not write a video

Lin1225 commented 3 years ago

I will try it, thank you!