Class ImageLabeller<T>
- Type Parameters:
T- the type of shared-state used by the labeller
- Direct Known Subclasses:
BinaryOutcomeImageLabeller,ImageCSVLabeller,ImageLabellerStringMap
Associates a label with an image.
This can be used to associate labels with images for training or evaluation in a machine-learning problem.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a set of identifiers for all groups that can be outputted by the labeller.abstract Tinitialize(Path pathForBinding) Initializes the labeller.abstract StringlabelFor(T sharedState, ProvidesStackInput input, InputOutputContext context) Determines a particular group-identifier (label) for an input.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ImageLabeller
public ImageLabeller()
-
-
Method Details
-
initialize
Initializes the labeller. Should be called once before calling any other methods.- Parameters:
pathForBinding- aPaththat can be used by the labeller to make file path decisions- Returns:
- the initialized shared-state of type
T - Throws:
InitializeException- if initialization fails
-
allLabels
Returns a set of identifiers for all groups that can be outputted by the labeller.This method should be callable at any time.
- Parameters:
initialization- the initialized shared-state returned byinitialize(Path)- Returns:
- a
SetofStringlabels
-
labelFor
public abstract String labelFor(T sharedState, ProvidesStackInput input, InputOutputContext context) throws OperationFailedException Determines a particular group-identifier (label) for an input.- Parameters:
sharedState- the shared-state returned byinitialize(Path)input- theProvidesStackInputto be labelledcontext- theInputOutputContextfor the operation- Returns:
- the label as a
String - Throws:
OperationFailedException- if the labelling operation fails
-