unsupervised_detection icon indicating copy to clipboard operation
unsupervised_detection copied to clipboard

question about optical flow resize

Open fupiao1998 opened this issue 5 years ago • 1 comments

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

fupiao1998 avatar Sep 22 '20 13:09 fupiao1998

Thanks for pointing it out! However, we are only interested in a normalized flow, not in the flow itself. In fact, a few lines afterward, we normalize it for a predefined factor: https://github.com/antonilo/unsupervised_detection/blob/master/models/adversarial_learner.py#L97. This kind of help during training since you decrease the input ranges.

antonilo avatar Oct 22 '20 16:10 antonilo