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 T
initialize
(Path pathForBinding) Initializes the labeller.abstract String
labelFor
(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
- aPath
that 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
Set
ofString
labels
-
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
- theProvidesStackInput
to be labelledcontext
- theInputOutputContext
for the operation- Returns:
- the label as a
String
- Throws:
OperationFailedException
- if the labelling operation fails
-