princeton-vl/RAFT

How to use it to calculate the optical flow

Dylan-Jinx opened this issue · 8 comments

I want to use RAFT model to predict optical flow,but I read your paper and source code,I don't know how to use it calculate the optical flow,now generate image of optical flow.

The demo.py shows how to use the model:

RAFT/demo.py

Line 62 in aac9dd5

flow_low, flow_up = model(image1, image2, iters=20, test_mode=True)

Save the flow result from the model and don't use the viz.

@pmazumder3927,hello,this code section:flow_low represents the previous frame and flow_up represents the optical flow distortion result of the next frame. Can I understand it in this way?

@Dylan-Jinx 在提供的代码片段中,flow_low 和 flow_up 是 RAFT 模型的输出。flow_low 代表较低分辨率(原始分辨率的 1/8)下的光流估计,而 flow_up 代表在原始分辨率下上采样和精细化的光流估计。精细化的光流(flow_up)用于可视化目的,因为它更准确地表示了两个输入图像之间的运动。

@pmazumder3927 你方便开个在线会议沟通一下吗,我可能有一些问题想要交流一下?

@Dylan-Jinx 如果你愿意,你可以给我发电子邮件来安排一个会议,但是我的中文不太好

@pmazumder3927 I have sent an email to the mailbox provided by your github homepage, you can check it.

@Dylan-Jinx 在提供的代码片段中,flow_low 和 flow_up 是 RAFT 模型的输出。flow_low 代表较低分辨率(原始分辨率的 1/8)下的光流估计,而 flow_up 代表在原始分辨率下上采样和精细化的光流估计。精细化的光流(flow_up)用于可视化目的,因为它更准确地表示了两个输入图像之间的运动。

你好,想请问这个flow_up表示的是从img1到img2还是img2到img1啊?如果使用gridsample进行warp,输入应该是img1和flow_up来得到从img1 warp 到 img2的结果么?谢谢你的解答。

@Gs-Zhang 在我看来,flow_up代表精细的,flow_low代表较低分辨率的,你看论文可以知道,有一个是原始分辨率的光流估计,也就是flow_low,那么你要使用的话我推荐是用flow_up,你如果有两个图片,那你就需要用两次去计算光流。