Skip to content

question about optical flow resize #9

@fupiao1998

Description

@fupiao1998

hello antonilo. Thank you for such an outstanding job! At line 89 in file adversarial_learner.py, you performed a resize operation on the optical flow, through tf.image.resize. However, whether the resize operation for optical flow should be multiplied by a coefficient after resize to maintain the consistency of optical flow values before and after resize. The following is a sample code:
def resize_flow(flow, new_shape):
_, _, h, w = flow.shape
new_h, new_w = new_shape
flow = torch.nn.functional.interpolate(flow, (new_h, new_w),
mode='bilinear', align_corners=True)
scale_h, scale_w = h / float(new_h), w / float(new_w)
flow[:, 0] /= scale_w
flow[:, 1] /= scale_h
return flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions