Skip to content
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

How to visualize the pixelwise flow? #37

Open
jlimsf opened this issue Jul 6, 2021 · 3 comments
Open

How to visualize the pixelwise flow? #37

jlimsf opened this issue Jul 6, 2021 · 3 comments

Comments

@jlimsf
Copy link

jlimsf commented Jul 6, 2021

How can we view the pixel wise flow in Figure 2? The output is of shape batch x 64 x 64 x 2

@AliaksandrSiarohin
Copy link
Collaborator

You can warp source image, or use optical flow visualization tools https://github.com/tomrunia/OpticalFlow_Visualization

@jlimsf
Copy link
Author

jlimsf commented Jul 6, 2021

what did you use for your paper to get the visualization?
here is what I am trying with flowvis

flow = motion_params['optical_flow'][0].squeeze()
print (flow.shape)
flow_np = flow.detach().cpu().numpy()
flow_im = flow_vis.flow_to_color(flow_np, convert_to_bgr=False)
print (flow_im)
flow_im = Image.fromarray(flow_im)
flow_im.save('flow.png')

this is the output I am getting.

flow (3)

@AliaksandrSiarohin
Copy link
Collaborator

I don't remember. Guess you need to subtract identity meshgrid and renormalize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants