tomas-gajarsky / facetorch

Python library for analysing faces using PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image normalization

Vuillecard opened this issue · comments

Hello,

Thank you for this project. It is very helpful. It seems to have a discrepancy in the normalization of the image. I noticed two potential issues:

  1. The detector retinaNnet applies some normalization which also affects the face crop data.face. Then, the normalization order should stay the same in the unifier to denormalize the face crop into [0,1]. Right now the face crop can have a negative value.
  2. The image is loaded with torchvision resulting in RGB images. From the RetinaNet implementation preprocessing the image is loaded in BGR format the mean they applied is (104, 117, 123). In facetorch, the transform is applied before rgbtobgr() thus I think that the correct order would be (123,117,104).

With the modification of point 1, all face crops are in [0,1]. For point 2 it is harder to check