royorel / Lifespan_Age_Transformation_Synthesis

Lifespan Age Transformation Synthesis code
Other
582 stars 132 forks source link

Paste output into original image, original image age prediction #21

Closed Sergej-dcai closed 3 years ago

Sergej-dcai commented 3 years ago

Hi Royorel

Really impressed by your work here! I am amazed by the accuracy of the outputs on some tests I did.

For my Python project, it would be even more amazing to be able to use the outputs combined with the original image, seeing the aging process on the photo itself basically. I tried digging around in the code, but I couldn't find a way to determine how the face is cut out of the image (basically I need to know "where" I should paste it over the original image). Is there any way you could help me out with this project?

As a side note, I was wondering if your algorithms can output the predicted age or some other way to determine the output image most fitting to the input. Is there something in the code that can give me an indication which pictures make the person older and which make the person younger?

Thanks a lot in advance for your helpful answers and keep up the astonishing work!

royorel commented 3 years ago

Hi @Serjura,

The functionality you're looking for is in this function: https://github.com/royorel/Lifespan_Age_Transformation_Synthesis/blob/7be4534848e94d9493dfb6da8dfd5724fa5f6766/util/preprocess_itw_im.py#L97

As for your other question. Our algorithm does not output a specific age but rather an age cluster, the naive age prediction would be to interpolate between the means of the age classes in the same ratio you interpolate between the latent code. However, we didn't do it in the paper, and we don't have any guarantees that this kind of prediction is indeed accurate.

Sergej-dcai commented 3 years ago

Hi @royorel Thank you for the response! I'm looking forward to using these suggestions.