Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to translation the rendered images? #16

Closed
csyuhao opened this issue Dec 29, 2020 · 1 comment
Closed

How to translation the rendered images? #16

csyuhao opened this issue Dec 29, 2020 · 1 comment

Comments

@csyuhao
Copy link

csyuhao commented Dec 29, 2020

Thanks for this exciting work.
I have a question about how to adjust the position of rendered images, as illustrated in the below image.
image

The left image is the rendered image, which is perfect. And I want to move down this image so that the neck part will be deleted. The key point here is that in the processed image, the forehead part should be shown, just like the right image.

But you can see the pose between the right image and the left image is much more different.

ps. the right image is generated by changing positions of transformed_vertices in SRenderY.forward().

transformed_vertices[:, :, :2] = transformed_vertices[:, :, :2] * self.image_size / 2 + self.image_size / 2
transform = torch.tensor(t_form, dtype=torch.float32).to(images.device).unsqueeze(0)
transform[:, :2, 2] = - transform[:, :2, 2]
transformed_vertices= torch.einsum('bij,bkj->bki', transform, transformed_vertices)
transformed_vertices[:, :, :2] = transformed_vertices[:, :, :2] / self.image_size * 2. - 1.

And t_form is

[
   [1, 0, 0],
   [0, 1, 20],
   [0, 0, 1]
]

Can you give me any advice to implement this work?

@csyuhao csyuhao closed this as completed Dec 30, 2020
@Dratlan
Copy link

Dratlan commented Dec 14, 2023

Hi, can you share you solutions for implement this work @csyuhao

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants