takuya-takeuchi / FaceRecognitionDotNet

The world's simplest facial recognition api for .NET on Windows, MacOS and Linux
MIT License
1.26k stars 306 forks source link

FaceEncoding class do not have properties to record: 'the image where its from' #110

Closed takuya-takeuchi closed 4 years ago

takuya-takeuchi commented 4 years ago

Thanks you and agree with you that do not expose the constructor of FaceEncoding.

here is another consideration please, the FaceEncoding class do not have properties to record: 'the image where its from', 'the rectangle where its from', 'the Entity where its related in real world' . so when we done a 1:n or m:n FacesCompare,it is really hard to related back the picture, the rectangle(we may draw a box on that face), the Entity(we should display the name or other info below face box) with the FaceEncoding. if we can have these properties inside the FaceEncoding class. the above tasks should be very easy. and I think these properties just free for get set,convient to use, do not slow down the Ecluid Distance computation.

Originally posted by @timiil in https://github.com/takuya-takeuchi/FaceRecognitionDotNet/issues/106#issuecomment-643159519

takuya-takeuchi commented 4 years ago

@timiil I understand what you hope. But FRDN is porting of face_recognition. Your requirements will occur large difference between FRDN and face_recognition.

FRDN should keep be simple and can catch up update of face_recognition anytime. For example, head pose esitmation and age/gender estimation are form of plugin. Because this function is not in face_recogniton. I keep low coupling of class design.

So your requirements should be achieved by upper layer of applicaiton.

timiil commented 4 years ago

@timiil I understand what you hope. But FRDN is porting of face_recognition. Your requirements will occur large difference between FRDN and face_recognition.

FRDN should keep be simple and can catch up update of face_recognition anytime. For example, head pose esitmation and age/gender estimation are form of plugin. Because this function is not in face_recogniton. I keep low coupling of class design.

So your requirements should be achieved by upper layer of applicaiton.

thanks for your reply, i think may be another way is : dot not sealed the FaceEncoding class, so the application layer can create a new class with 'full gear porperties' which inherited from FaceEncoding.

takuya-takeuchi commented 4 years ago

@timiil From view point of my experience of development of AFIS, iris and face recogtnion system, feature data class (this case: FaceEncoding) must not have many data. We create one entity class and it hold encoding data.

class FeatureData
{
    byte[] feature;
    int featureType;
}

class Finger
{
   int fingerPosition;
   FeatureData feature;
}

class PersonData
{
   Finger[] fingers;
   string name;
}

FaceEncoding class represents face encoding data. Why does FaceEncoding class represent person name or origin of image? It's not responsiblity of FaceEncoding. It is not task of FaceRecognition but task of business application like domain logic.

If I remove sealed modifier of FaceEncoding class, someone derive FaceEncoding class. It means that it is hard to modify FaceEncoding class. My modification of FaceEncoding class may occurs any problem on derived FaceEncoding class. In this case, someone requires me to revert modification or fix problem. Yes, it is easy to reject someone's requirements but bad aftertast.

In conclusion, I can not remove sealed modifier of FaceEncoding class.

Thanks a lot.