T
- model-typepublic abstract class SegmentStackIntoObjectsPooled<T extends InferenceModel> extends SegmentationBean<SegmentStackIntoObjectsPooled<T>>
These models are typically CNN deep-learning models.
Constructor and Description |
---|
SegmentStackIntoObjectsPooled() |
Modifier and Type | Method and Description |
---|---|
abstract ConcurrentModelPool<T> |
createModelPool(ConcurrencyPlan plan,
Logger logger)
Creates the model pool (to be used by multiple threads).
|
protected Path |
resolve(String modelFilename)
Resolves a relative filename for a model into a path, relative to the model directory.
|
abstract SegmentedObjects |
segment(Stack stack,
ConcurrentModelPool<T> modelPool,
ExecutionTimeRecorder executionTimeRecorder)
Segments a stack to produce an object-collection.
|
SegmentedObjects |
segment(Stack stack,
ExecutionTimeRecorder executionTimeRecorder)
Segments individually using a pool of size 1 just for one stack.
|
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public SegmentedObjects segment(Stack stack, ExecutionTimeRecorder executionTimeRecorder) throws SegmentationFailedException
See segment(Stack, ConcurrentModelPool, ExecutionTimeRecorder)
for more details.
stack
- the stack to segment.executionTimeRecorder
- for measuring execution-times of operations.SegmentationFailedException
- if anything goes wrong during the segmentation.public abstract ConcurrentModelPool<T> createModelPool(ConcurrencyPlan plan, Logger logger) throws CreateModelFailedException
plan
- the number and types of processors available for concurrent execution.logger
- the logger.CreateModelFailedException
- if a model cannot be created.public abstract SegmentedObjects segment(Stack stack, ConcurrentModelPool<T> modelPool, ExecutionTimeRecorder executionTimeRecorder) throws SegmentationFailedException
Any created objects will always exist inside the stack's Extent
.
stack
- the stack to segment.modelPool
- the pool of model instances which can each be used for inference (in
parallel).executionTimeRecorder
- measures execution-times of particular operations.SegmentationFailedException
- if anything goes wrong during the segmentation.protected Path resolve(String modelFilename) throws InitializeException
modelFilename
- the filename for the model (to the model directory).InitializeException
- if a bean requires initialization, but has not been initialized.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.