Closed personal-coding closed 1 year ago
The easiest way is to pass each image as inputs sequentially (as is done in predict_humaniflow.py anyway) - all you have to do is change the for loop here to be over the video/gif frames.
If you want to predict in parallel, which I think is what you have attempted in your code, you need to concatenate the proxy representations in the batch dimension (dim=0), not dim=1. Moreover, you would need change visualisation code to work in a batched manner. This would probably be a hassle, so I would recommend going for the sequential method, unless speed is a big concern.
What is the best way to update the code to work on multiple images or a video? I attempted to use VideoCapture on a gif file to read each frame. However, I am having difficulty appending each image and heatmap together to be fed into the model.
This is in the
predict_humaniflow.py
script: