-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to reorder the flow tensor when transpose_image is true? #57
Comments
Hi! Thank you for your interest to our work! The function During the post-processing stage, in the Therefore, if we want to use the optical flow for our model in the subsequent codes, we do not need to worry about whether the image was transposed, as the flow directions have already been properly adjusted in the post-processing function. |
No it's not about transposing the flow tensor. It's about reordering the dimension that has size 2 flows[:, [0,1]] = flows[:, [1,0]] such that the first slice always corresponds to width and the second one corresponds to height. Right now if the video is in portrait mode, flows[;, 0] corresponds to height. This cannot be right for later operations. But i suppose this issue did not hurt your training because most webvid10M videos are landscape. |
Oh, I understand your point. I think you are right, we indeed need to perform I originally copied the optical flow prediction codes from Unimatch: https://github.com/autonomousvision/unimatch/blob/master/evaluate_flow.py#L642 from line 714 to line 760. It is a little wierd that the origin script do not reorder the predicted flow with Maybe I missed some parts? |
in postprocess_size() in train_stage_1.py
when transpose_img is set to true, we need to reorder flows like this
flows[:, [0,1]] = flows[:, [1,0]]
This makes sure that flows[:, 0] corresponds to width.
Right?
The text was updated successfully, but these errors were encountered: