snap-research / articulated-animation

Code for Motion Representations for Articulated Animation paper
https://snap-research.github.io/articulated-animation/
Other
1.21k stars 348 forks source link

How to visualize the pixelwise flow? #37

Open jlimsf opened 3 years ago

jlimsf commented 3 years ago

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

AliaksandrSiarohin commented 3 years ago

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

jlimsf commented 3 years ago

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 commented 3 years ago

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