OBJECT
- Type of objectANNOTATION
- Type of annotationpublic class InstanceCachingIncrementalBatchAnnotator<OBJECT,ANNOTATION> extends IncrementalAnnotator<OBJECT,ANNOTATION>
BatchAnnotator
to behave like a
IncrementalAnnotator
by caching instances and then performing
training only when annotate(Object)
is called.Constructor and Description |
---|
InstanceCachingIncrementalBatchAnnotator(BatchAnnotator<OBJECT,ANNOTATION> batchAnnotator)
Construct with an in-memory cache and the given batch annotator.
|
InstanceCachingIncrementalBatchAnnotator(BatchAnnotator<OBJECT,ANNOTATION> batchAnnotator,
GroupedListCache<ANNOTATION,OBJECT> cache)
Construct with the given batch annotator and cache implementation.
|
Modifier and Type | Method and Description |
---|---|
List<ScoredAnnotation<ANNOTATION>> |
annotate(OBJECT object)
Generate annotations for the given object.
|
Set<ANNOTATION> |
getAnnotations() |
void |
reset()
Reset the object to its initial condition, as if
it hasn't seen any training data.
|
void |
train(Annotated<OBJECT,ANNOTATION> annotated)
Train/update object using a new instance.
|
train, train, trainMultiClass
classify
public InstanceCachingIncrementalBatchAnnotator(BatchAnnotator<OBJECT,ANNOTATION> batchAnnotator)
batchAnnotator
- the batch annotatorpublic InstanceCachingIncrementalBatchAnnotator(BatchAnnotator<OBJECT,ANNOTATION> batchAnnotator, GroupedListCache<ANNOTATION,OBJECT> cache)
batchAnnotator
- the batch annotatorcache
- the cachepublic void train(Annotated<OBJECT,ANNOTATION> annotated)
IncrementalTrainer
annotated
- instance to train withpublic void reset()
IncrementalTrainer
public Set<ANNOTATION> getAnnotations()
public List<ScoredAnnotation<ANNOTATION>> annotate(OBJECT object)
Annotator
object
- the image