FACE - Type of DetectedFacePERSON - Type of object representing a personpublic class EigenFaceRecogniser<FACE extends DetectedFace,PERSON> extends FaceRecogniser<FACE,PERSON>
FaceRecogniser based on Eigenfaces. Any kind of
machine learning implementation can be used for the actual classification.| Modifier | Constructor and Description |
|---|---|
protected |
EigenFaceRecogniser() |
|
EigenFaceRecogniser(EigenFaceFeature.Extractor<FACE> extractor,
FaceRecogniser<FACE,PERSON> internalRecogniser)
Construct with the given feature extractor and underlying
FaceRecogniser. |
|
EigenFaceRecogniser(EigenFaceFeature.Extractor<FACE> extractor,
IncrementalAnnotator<FACE,PERSON> annotator)
Construct with the given feature extractor and underlying
IncrementalAnnotator. |
| Modifier and Type | Method and Description |
|---|---|
List<ScoredAnnotation<PERSON>> |
annotate(FACE object)
Attempt to recognize the given face.
|
List<ScoredAnnotation<PERSON>> |
annotate(FACE object,
Collection<PERSON> restrict)
Attempt to recognize the given face, restricting the potential people to
coming from the given set.
|
protected void |
beforeBatchTrain(GroupedDataset<PERSON,ListDataset<FACE>,FACE> dataset)
Called before batch training/re-training takes place.
|
byte[] |
binaryHeader()
Header for binary input.
|
static <FACE extends DetectedFace,PERSON> |
create(int numComponents,
FaceAligner<FACE> aligner,
int k,
DoubleFVComparator compar)
Convenience method to create an
EigenFaceRecogniser with a
standard KNN classifier. |
static <FACE extends DetectedFace,PERSON> |
create(int numComponents,
FaceAligner<FACE> aligner,
int k,
DoubleFVComparator compar,
float threshold)
Convenience method to create an
EigenFaceRecogniser with a
standard KNN classifier, incorporating a threshold on the maximum
distance (or minimum similarity) to allow a match. |
Set<PERSON> |
getAnnotations() |
void |
readBinary(DataInput in)
Read internal state from in.
|
void |
reset()
Reset the object to its initial condition, as if
it hasn't seen any training data.
|
String |
toString() |
void |
train(Annotated<FACE,PERSON> annotated)
Train/update object using a new instance.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
annotateBest, annotateBest, listPeopletrain, train, trainMultiClassclassifyprotected EigenFaceRecogniser()
public EigenFaceRecogniser(EigenFaceFeature.Extractor<FACE> extractor, FaceRecogniser<FACE,PERSON> internalRecogniser)
FaceRecogniser.extractor - the feature extractorinternalRecogniser - the face recogniserpublic EigenFaceRecogniser(EigenFaceFeature.Extractor<FACE> extractor, IncrementalAnnotator<FACE,PERSON> annotator)
IncrementalAnnotator.extractor - the feature extractorannotator - the annotatorpublic static <FACE extends DetectedFace,PERSON> EigenFaceRecogniser<FACE,PERSON> create(int numComponents, FaceAligner<FACE> aligner, int k, DoubleFVComparator compar, float threshold)
EigenFaceRecogniser with a
standard KNN classifier, incorporating a threshold on the maximum
distance (or minimum similarity) to allow a match.FACE - The type of DetectedFacePERSON - the type representing a personnumComponents - the number of principal components to keepaligner - the face alignerk - the number of nearest neighbourscompar - the distance comparison functionthreshold - a distance threshold to limit matches.EigenFaceRecogniserpublic static <FACE extends DetectedFace,PERSON> EigenFaceRecogniser<FACE,PERSON> create(int numComponents, FaceAligner<FACE> aligner, int k, DoubleFVComparator compar)
EigenFaceRecogniser with a
standard KNN classifier.FACE - The type of DetectedFacePERSON - the type representing a personnumComponents - the number of principal components to keepaligner - the face alignerk - the number of nearest neighbourscompar - the distance comparison functionEigenFaceRecogniserprotected void beforeBatchTrain(GroupedDataset<PERSON,ListDataset<FACE>,FACE> dataset)
dataset - the datasetpublic void readBinary(DataInput in) throws IOException
ReadableBinaryin - source to read from.IOException - an error reading inputpublic void writeBinary(DataOutput out) throws IOException
WriteableBinaryout - sink to write toIOException - an error writing to outpublic byte[] binaryHeader()
ReadableBinarypublic void train(Annotated<FACE,PERSON> annotated)
IncrementalTrainerannotated - instance to train withpublic void reset()
IncrementalTrainerpublic Set<PERSON> getAnnotations()
public List<ScoredAnnotation<PERSON>> annotate(FACE object, Collection<PERSON> restrict)
FaceRecogniserannotate in interface RestrictedAnnotator<FACE extends DetectedFace,PERSON>annotate in class FaceRecogniser<FACE extends DetectedFace,PERSON>object - the detected facerestrict - the set of allowed peoplepublic List<ScoredAnnotation<PERSON>> annotate(FACE object)
FaceRecogniserannotate in interface Annotator<FACE extends DetectedFace,PERSON>annotate in class FaceRecogniser<FACE extends DetectedFace,PERSON>object - the detected face