question about optical flow resize
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
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.