dougsouza / face-frontalization

This is a port of the Face Frontalization code provided by Hassner et al. at http://www.openu.ac.il/home/hassner/projects/frontalize
276 stars 113 forks source link

wrong results for large images #7

Open leoneckert opened 8 years ago

leoneckert commented 8 years ago

Hello, do you have an idea why I am getting so very different results for the same image depending on its dimensions? If it is too big the program doesn't seem to be doing the right thing after detecting the facial landmarks. Any help would be very much appreciated, I'll attach screenshots of two versions of the same image. Thanks! Here the large version: screenshot from 2016-06-20 14 53 11 copy And the small one: screenshot from 2016-06-20 14 54 49 copy

dougsouza commented 8 years ago

Hi @leoneckert,

Yes, this is known issue, and was already discussed here #5. We still don't have a fix for that rather than resizing the input to a smaller dimension.

Cheers.

Doug

leoneckert commented 8 years ago

Okay, thanks for coming back to me! I thought maybe a solution has been found already.

Is the problem maybe the 3D model that's being used? Feels like the model has those particular dimensions and trying to "wrap" something larger around it, results get crazy... Just a feeling, have been digging into the code, but couldn't rhyme together any other explanation to the problem :)

Anyhow, thanks again

mwlodarczyk commented 8 years ago

Hi @dougsouza,

Any update on the problem with large images? Any clue where we can search for a bug when debugging?

Best, Michal

dougsouza commented 8 years ago

@mwlodarczyk,

To be honest, I haven't worked on this project lately. Regarding the issue: I think the problem may be related to size of the 3D model and the reference image that are used to calibrate the camera. I think that part is a good place to start debugging.

Cheers,

Doug

TalHassner commented 8 years ago

@mwlodarczyk,

I'm also uncertain why this happens. There really shouldn't be any reason for this, especially if you're not using symmetry (which is the only part I believe depends on the size of the input image). I may be wrong and it has been some time since I looked at the code.

I wonder, however, why you don't simply rescale the input image to a size that works, as a simple solution.

If this leads to problems with landmark detection (i.e., you need the high resolution to detect the landmarks) you can simply detect the landmarks on the high rez image, then rescale it AND the landmark coordinates.

Did you try something like this?

Tal

mwlodarczyk commented 8 years ago

@TalHassner,

Once I resized the image, the code works fine. However, I want to try using this face frontalization for biometrics recognition purposes. Therefore, I want to have high quality image to get the best possible results. When resizing, the obtained image quality is not good enough for my purposes.

Currently, I am busy with some other issues. I will get back to this code around the middle of September. I will let you know if I find anything interesting.

Best, Michal

oxydron commented 8 years ago

Anyone know which dimension should a face have to work okay?

Best regards

oxydron commented 8 years ago

Some tests suggests that if the face height belongs to [150,220] interval pixels, the algorithm works just fine. While we no fix is made, I suggest to resize faces proportionally with height in this interval.

Best regards