takuya-takeuchi / DlibDotNet

Dlib .NET wrapper written in C++ and C# for Windows, MacOS, Linux and iOS
MIT License
490 stars 135 forks source link

GetFaceChipDetail not working well when using a FullObjectDetection instantiated with the face rectangle and landmarks #219

Open jpsalada opened 3 years ago

jpsalada commented 3 years ago

Hi,

FullObjectDetection exposes a constructor where we can input the face rectangle and the facel andmark points. This is pretty useful when we have datasets that expose this information annotated, so we do not have to repeat work.

However when we do GetFaceChipDetal with that instance, the face is not normalized correctly, namely the rotation at least. It seems to only work well when the object FullObjectDetection is filled and returned by the ShapePredictor model.

takuya-takeuchi commented 3 years ago

@jpsalada

You are correct. But it is specification of dlib rather than DlibDotNet. You can find dlib transforms fixed points to input point (FullObjectDetection). https://github.com/davisking/dlib/blob/f4f8bff95ec84d441953fb854c5261655c22c824/dlib/image_transforms/interpolation_abstract.h#L1399 https://github.com/davisking/dlib/blob/f4f8bff95ec84d441953fb854c5261655c22c824/dlib/image_transforms/interpolation.h#L1942