Face recognition: face crop parameters, eye and mouth positions

381 views
Skip to first unread message

dmytro....@buddyguard.io

unread,
Nov 19, 2015, 6:37:30 AM11/19/15
to bob-devel
Hi,

I tried facereclib for face recognition on ColorFERET database and was quite happy with the result (1.43% HTER).
Both for training and testing I used preprocessed images, namely only cropped faces images (crops obtained from OpenCV with Haar cascade) of 128x128 pixels.
Images have no landmark annotations.

In the Experiment.info I found the following:

Preprocessing:
facereclib
.preprocessing.TanTriggs.TanTriggs(mask_neighbors=5, color_channel=gray, cropped_positions={'reye': (16, 15), 'eye': (16, 20), 'mouth': (52, 20), 'leye': (16, 48)}, offset=0, threshold=10.0, alpha=0.1, cropped_image_size=(80, 64), sigma1=2, sigma0=1, gamma=0.2, size=5)


Eye and mouth positions looks like a default configuration from facereclib/configurations/preprocessing/face_crop.py, where an image assumed to be 80x64 pixels.
So, I am wondering: did I trained model on my 128x128 images using preprocessing parameters for 80x64?

If so, what is the convenient way to explicitly specify the preprocessing parameters, at least image size?

Yours,
Dmytro

Sebastien Marcel

unread,
Nov 19, 2015, 8:12:16 AM11/19/15
to bob-devel
congratulations

you will be most welcomed to contribute at least with a new Bob Database API for ColorFERET.
Examples:

and also possibly to share you new face recognition recipe as a Bob satellite package ( https://www.idiap.ch/software/bob/docs/releases/last/sphinx/html/OrganizeYourCode.html )
Examples:

Manuel Günther

unread,
Nov 19, 2015, 10:47:02 AM11/19/15
to bob-devel
Dear Dmytro,

first of all, I am not sure, which algorithm you were using to achieve your result. Could you please provide the exact command line that you used?

I should tell you that the facereclib is outdated and has been superseded by bob.bio.face: http://pypi.python.org/pypi/bob.bio.face. Please switch to the new package, as things have been implemented more clean there.
One of the points is that -- in facereclib -- the preprocessor silently ignores the image resolution and eye locations, when no annotations are specified during preprocessing (i.e., being None as the default in https://github.com/idiap/facereclib/blob/master/facereclib/preprocessing/TanTriggs.py#L86).
The annotations themselves are provided by the database. As you have implemented your own database interface, I assume that you did not implement the annotations (since your images are already aligned), so no further alignment is needed in the preprocessors.

In bob.bio.face, you can specify the face cropping parameters (via the face_cropper parameter) in the preprocessor constructors, such as: https://github.com/bioidiap/bob.bio.face/blob/master/bob/bio/face/preprocessor/TanTriggs.py#L48
There, when a preprocessor is specified and the required annotations are not provided, an error is raised.
If you use pre-cropped images, you can simply set the face_cropper parameter to None.

So, in summary: I assume that you used images in resolution 128x128. You can check the images using HDF5 tools (such as hdfview) to open the preprocessed images (usually located under temp/<sub-dir>/preprocessed, depending on your command line).

I hope that answered your question. If not, feel free to be more inquiring :-)
Manuel

dmytro....@buddyguard.io

unread,
Nov 19, 2015, 11:16:54 AM11/19/15
to bob-devel
Dear Manuel,

I was using isv with dct features and tantriggs preprocessing (taken from baselines.py -a isv).

Wow, I did not know, facereclib was superseded, thanks for the hint.


On Thursday, November 19, 2015 at 4:47:02 PM UTC+1, Manuel Günther wrote:
Dear Dmytro,

first of all, I am not sure, which algorithm you were using to achieve your result. Could you please provide the exact command line that you used?

I should tell you that the facereclib is outdated and has been superseded by bob.bio.face: http://pypi.python.org/pypi/bob.bio.face. Please switch to the new package, as things have been implemented more clean there.
One of the points is that -- in facereclib -- the preprocessor silently ignores the image resolution and eye locations, when no annotations are specified during preprocessing (i.e., being None as the default in https://github.com/idiap/facereclib/blob/master/facereclib/preprocessing/TanTriggs.py#L86).
The annotations themselves are provided by the database. As you have implemented your own database interface, I assume that you did not implement the annotations (since your images are already aligned), so no further alignment is needed in the preprocessors.

True, I provided no annotations, since there are no.
 
In bob.bio.face, you can specify the face cropping parameters (via the face_cropper parameter) in the preprocessor constructors, such as: https://github.com/bioidiap/bob.bio.face/blob/master/bob/bio/face/preprocessor/TanTriggs.py#L48
There, when a preprocessor is specified and the required annotations are not provided, an error is raised.
If you use pre-cropped images, you can simply set the face_cropper parameter to None.

So, in summary: I assume that you used images in resolution 128x128. You can check the images using HDF5 tools (such as hdfview) to open the preprocessed images (usually located under temp/<sub-dir>/preprocessed, depending on your command line).

I hope that answered your question. If not, feel free to be more inquiring :-)

Thank you, I will play around it!
 
Manuel

Reply all
Reply to author
Forward
0 new messages