Class SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel>
Object
org.anchoranalysis.plugin.image.task.segment.SharedStateSegmentInstance<T>
- Type Parameters:
T- model-type in pool
public class SharedStateSegmentInstance<T extends org.anchoranalysis.inference.InferenceModel> extends Object
Shared-state for instance segmentation.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors Constructor Description SharedStateSegmentInstance(org.anchoranalysis.inference.concurrency.ConcurrentModelPool<T> modelPool, org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> featureTable, org.anchoranalysis.feature.io.csv.metadata.LabelHeaders identifierHeaders, String outputNameFeatures, FeatureExporterContext context)Creates a new instance of SharedStateSegmentInstance. -
Method Summary
Modifier and Type Method Description voidcloseAndWriteOutputs(ExportFeaturesStyle style)Writes all the results that have been collected as a CSV file, and closes open I/O handles and memory structures.FeatureCalculationContext<org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>>createCalculationContext(org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder, org.anchoranalysis.io.output.outputter.InputOutputContext ioContext)Creates aFeatureCalculationContextfor calculating features to later use this exporter.org.anchoranalysis.inference.concurrency.ConcurrentModelPool<T>getModelPool()The concurrent model pool for inference.
-
Constructor Details
-
SharedStateSegmentInstance
public SharedStateSegmentInstance(org.anchoranalysis.inference.concurrency.ConcurrentModelPool<T> modelPool, org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<org.anchoranalysis.image.feature.input.FeatureInputSingleObject> featureTable, org.anchoranalysis.feature.io.csv.metadata.LabelHeaders identifierHeaders, String outputNameFeatures, FeatureExporterContext context) throws org.anchoranalysis.core.exception.CreateExceptionCreates a new instance of SharedStateSegmentInstance.- Parameters:
modelPool- the concurrent model poolfeatureTable- the feature table calculatoridentifierHeaders- the label headers for identifiersoutputNameFeatures- the output name for featurescontext- the feature exporter context- Throws:
org.anchoranalysis.core.exception.CreateException- if there's an error creating the feature exporter
-
-
Method Details
-
createCalculationContext
public FeatureCalculationContext<org.anchoranalysis.image.feature.calculator.FeatureTableCalculator<org.anchoranalysis.image.feature.input.FeatureInputSingleObject>> createCalculationContext(org.anchoranalysis.core.time.ExecutionTimeRecorder executionTimeRecorder, org.anchoranalysis.io.output.outputter.InputOutputContext ioContext)Creates aFeatureCalculationContextfor calculating features to later use this exporter.- Parameters:
executionTimeRecorder- records execution-times.ioContext- IO-context.- Returns:
- a newly created context.
-
closeAndWriteOutputs
public void closeAndWriteOutputs(ExportFeaturesStyle style) throws org.anchoranalysis.io.output.error.OutputWriteFailedExceptionWrites all the results that have been collected as a CSV file, and closes open I/O handles and memory structures.- Parameters:
style- the style for exporting features- Throws:
org.anchoranalysis.io.output.error.OutputWriteFailedException- if any output cannot be written, or there is an error closing open I/O.
-
getModelPool
The concurrent model pool for inference.
-