open-mmlab / mmflow

OpenMMLab optical flow toolbox and benchmark

Home Page:https://mmflow.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How should I calculate the forward and backward flow?

SuleBai opened this issue · comments

Thanks for your great work!

I am new to optical flow. Now I want to use occlusion_estimation() defined in occlusion_estimation.py. I see the annotations "flow_fw (Tensor): The forward flow with shape (N, 2, H, W)". Since now I get 25 extracted frames each video, I am wondering how to calculate the forward flow and backward flow? Do I need to iteratively rum image_demo.py and then concatenate all the results on the first dimension?

Thanks again for your great work.

Yes, most of model in mmflow only predicts florward flow i.e. from img1 to img2. If you would like to calculate the backward flow, you can try IRR-PWC https://github.com/open-mmlab/mmflow/tree/master/configs/irr, or just run image_demo.py again for img2 and img1

Thanks a lot! I have solved the problem!