PRNet-PyTorch
PRNet-PyTorch copied to clipboard
Rotate uv_position_map
Hi @reshow In file augmentation.py, there is a rotateData function, whose input are x, y, ..... . Obviously, x is the network input image, y is the uv_position_map(or target, label, ground truth). But I confused to follow code:
rotate_y = y.copy()
rotate_y[:, :, 2] = 1.
rotate_y = rotate_y.reshape(image_width * image_height, image_channel)
# rotate_y = rotate_y.dot(rform.T)
rotate_y = myDot(rotate_y, rform.T)
rotate_y = rotate_y.reshape(image_height, image_width, image_channel)
rotate_y[:, :, 2] = y[:, :, 2]
Here, you only rotate the first two channels of y, whose shape is [height,width,channels]. But the third channel do nothing. I can not understand it. Would you interpret to me? Thank you so much!!
Hi @reshow In file augmentation.py, there is a rotateData function, whose input are x, y, ..... . Obviously, x is the network input image, y is the uv_position_map(or target, label, ground truth). But I confused to follow code:
rotate_y = y.copy() rotate_y[:, :, 2] = 1. rotate_y = rotate_y.reshape(image_width * image_height, image_channel) # rotate_y = rotate_y.dot(rform.T) rotate_y = myDot(rotate_y, rform.T) rotate_y = rotate_y.reshape(image_height, image_width, image_channel) rotate_y[:, :, 2] = y[:, :, 2]Here, you only rotate the first two channels of y, whose shape is [height,width,channels]. But the third channel do nothing. I can not understand it. Would you interpret to me? Thank you so much!!
The rotation is performed on XY plane. So the depth doesn't change.
这里的旋转我也有同样的疑问就是在于如果直接对uv_map进行旋转是否是正确的,因为不管原图如何旋转,uv_map中每个点的含义应当保持一致,以眼睛中心为例,这个点在uvmap中的位置应当是不变的,但是如果直接旋转uv_map是否意味着眼睛中心点在这个map中的坐标位置已经发生改变了呢,希望您能替我解答一下。
这里的旋转我也有同样的疑问就是在于如果直接对uv_map进行旋转是否是正确的,因为不管原图如何旋转,uv_map中每个点的含义应当保持一致,以眼睛中心为例,这个点在uvmap中的位置应当是不变的,但是如果直接旋转uv_map是否意味着眼睛中心点在这个map中的坐标位置已经发生改变了呢,希望您能替我解答一下。
The rotation of image is changing the position of pixels. But the rotation of uv map is changing the xy values of points.
这里的旋转我也有同样的疑问就是在于如果直接对uv_map进行旋转是否是正确的,因为不管原图如何旋转,uv_map中每个点的含义应当保持一致,以眼睛中心为例,这个点在uvmap中的位置应当是不变的,但是如果直接旋转uv_map是否意味着眼睛中心点在这个map中的坐标位置已经发生改变了呢,希望您能替我解答一下。
The rotation of image is changing the position of pixels. But the rotation of uv map is changing the xy values of points.
OK, I got that. Thank you very much!