Thanks for releasing the code for spatial transformation.
I have a question for these rows for getting pixel value at corner coordinates in layer.py
Ia = tf.gather_nd(images, tf.stack([b, y0, x0], 3), name='Ia')
The shape of the indices will be [B, H, W, 3]. For color images with shape [B, H, W, 3], after gathering slices, it gets the output with shape [B, H, W, 3].
But for the singe channel images with shape [B, H, W, 1], I do not understand how to gather the slices given the indices [B, H, W, 3] via tf.gather_nd and get the output with [B, H, W, 1]?
Could you please guide me in understanding how this works?
Thanks for your help!
Hi Berangerd,
Thanks for releasing the code for spatial transformation. I have a question for these rows for getting pixel value at corner coordinates in
layer.py
Ia = tf.gather_nd(images, tf.stack([b, y0, x0], 3), name='Ia')
The shape of the indices will be [B, H, W, 3]. For color images with shape [B, H, W, 3], after gathering slices, it gets the output with shape [B, H, W, 3].
But for the singe channel images with shape [B, H, W, 1], I do not understand how to gather the slices given the indices [B, H, W, 3] via
tf.gather_nd
and get the output with [B, H, W, 1]?Could you please guide me in understanding how this works? Thanks for your help!