FACE - Type of DetectedFacePERSON - Type of object representing a personpublic class AnnotatorFaceRecogniser<FACE extends DetectedFace,PERSON> extends FaceRecogniser<FACE,PERSON>
FaceRecogniser built on top of an IncrementalAnnotator.
This class essentially adapts standard IncrementalAnnotator to work
in the face recognition scenario.| Modifier and Type | Field and Description |
|---|---|
protected IncrementalAnnotator<FACE,PERSON> |
annotator |
| Modifier | Constructor and Description |
|---|---|
protected |
AnnotatorFaceRecogniser() |
|
AnnotatorFaceRecogniser(IncrementalAnnotator<FACE,PERSON> annotator)
Construct with the given underlying annotator.
|
| 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.
|
byte[] |
binaryHeader()
Header for binary input.
|
static <FACE extends DetectedFace,EXTRACTOR extends FeatureExtractor<?,FACE>,PERSON> |
create(IncrementalAnnotator<FACE,PERSON> annotator)
Convenience method to create
AnnotatorFaceRecogniser instances
from an annotator. |
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> annotedImage)
Train/update object using a new instance.
|
void |
train(Iterable<? extends Annotated<FACE,PERSON>> data)
Train the annotator with the given data.
|
void |
writeBinary(DataOutput out)
Write the content of this as binary to out.
|
annotateBest, annotateBest, listPeopletrain, trainMultiClassclassifyprotected IncrementalAnnotator<FACE extends DetectedFace,PERSON> annotator
protected AnnotatorFaceRecogniser()
public AnnotatorFaceRecogniser(IncrementalAnnotator<FACE,PERSON> annotator)
annotator - the annotatorpublic static <FACE extends DetectedFace,EXTRACTOR extends FeatureExtractor<?,FACE>,PERSON> AnnotatorFaceRecogniser<FACE,PERSON> create(IncrementalAnnotator<FACE,PERSON> annotator)
AnnotatorFaceRecogniser instances
from an annotator.FACE - Type of DetectedFaceEXTRACTOR - Type of FeatureExtractorPERSON - Type of object representing a personannotator - the annotatorAnnotatorFaceRecogniser instancepublic void readBinary(DataInput in) throws IOException
ReadableBinaryin - source to read from.IOException - an error reading inputpublic byte[] binaryHeader()
ReadableBinarypublic void writeBinary(DataOutput out) throws IOException
WriteableBinaryout - sink to write toIOException - an error writing to outpublic 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 facepublic void train(Annotated<FACE,PERSON> annotedImage)
IncrementalTrainerannotedImage - instance to train withpublic void train(Iterable<? extends Annotated<FACE,PERSON>> data)
IncrementalAnnotatorIncrementalTrainer.train(Object) on each data item.
Subclasses may override to do something more intelligent if necessary.train in interface IncrementalTrainer<Annotated<FACE extends DetectedFace,PERSON>>train in class IncrementalAnnotator<FACE extends DetectedFace,PERSON>data - the training datapublic Set<PERSON> getAnnotations()
public void reset()
IncrementalTrainer