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 get the face texture? #16

Closed
sunshinewhy opened this issue Nov 29, 2021 · 7 comments
Closed

How to get the face texture? #16

sunshinewhy opened this issue Nov 29, 2021 · 7 comments

Comments

@sunshinewhy
Copy link

Thank you for your awesome work!
After running your project, I get the reconstructed face image and *.obj file, can you tell me how to get the rendered image just like these?
2

@ascust
Copy link
Owner

ascust commented Nov 30, 2021

Please have a look at this line:

rendered_img = pred_dict['rendered_img']

I guess this is what you are looking for. It is basically the output from the renderer of Pytorch3D, which is a 4 channel image (the forth channel is a mask). So simply convert it into a uint8 array and save it to an image type.

@sunshinewhy
Copy link
Author

Please have a look at this line:

rendered_img = pred_dict['rendered_img']

I guess this is what you are looking for. It is basically the output from the renderer of Pytorch3D, which is a 4 channel image (the forth channel is a mask). So simply convert it into a uint8 array and save it to an image type.

Yes, you are right. You provide some images in data folder, and I want to know if I replace these images, should I retrain the model?

@ascust
Copy link
Owner

ascust commented Dec 1, 2021

@sunshinewhy those are some sample images. It has nothing to do with model training. All the code does is "given an image or a video, the code is trying to find a set of parameters to describe the reconstructed image or the video."

@sunshinewhy
Copy link
Author

@sunshinewhy those are some sample images. It has nothing to do with model training. All the code does is "given an image or a video, the code is trying to find a set of parameters to describe the reconstructed image or the video."

Nice, thanks a lot!

@sunshinewhy
Copy link
Author

I use one RTX3080 GPU to render the image, each image cost about 35s (including 4s no-rigid render and 33s rigid render), I want to reduce the time. I find you provide the hyperparameters in the file, could you tell me how to set them, I will be grateful.

@ascust
Copy link
Owner

ascust commented Dec 3, 2021

@sunshinewhy In the current version, I only use Adam as the optimizer to iteratively update variables, which might not be a fast way. To speed things up, one could replace the optimization method with some faster ones. I have not dug into it yet.

@sunshinewhy
Copy link
Author

@ascust Okay, I reset the hyperparameters, it will save the time, but the results not good, maybe I should try other methods.

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