Class SuppressNonMaximum<T extends InferenceModel>
- Type Parameters:
T
- model-type
Applies a segmentation procedure followed by non-maximum suppression.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionSuppressNonMaximum
(SegmentStackIntoObjectsPooled<T> segment) Creates with a particular segmentation algorithm as an input.SuppressNonMaximum
(SegmentStackIntoObjectsPooled<T> segment, ReduceElements<ObjectMask> reduce, boolean separateEachLabel) Creates a newSuppressNonMaximum
instance. -
Method Summary
Modifier and TypeMethodDescriptioncreateModelPool
(ConcurrencyPlan plan, Logger logger) Creates the model pool (to be used by multiple threads).The algorithm for reducing the number of object-masks.The segmentation algorithm that is applied as an input to non-maximum suppression.boolean
If true, each label is reduced separately. if false, all labels are reduced together.segment
(Stack stack, ConcurrentModelPool<T> modelPool, ExecutionTimeRecorder executionTimeRecorder) Segments a stack to produce an object-collection.void
setReduce
(ReduceElements<ObjectMask> reduce) The algorithm for reducing the number of object-masks.void
setSegment
(SegmentStackIntoObjectsPooled<T> segment) The segmentation algorithm that is applied as an input to non-maximum suppression.void
setSeparateEachLabel
(boolean separateEachLabel) If true, each label is reduced separately. if false, all labels are reduced together.Methods inherited from class org.anchoranalysis.image.inference.bean.segment.instance.SegmentStackIntoObjectsPooled
resolve, segment
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
SuppressNonMaximum
Creates with a particular segmentation algorithm as an input.- Parameters:
segment
- the segmentation algorithm to use, before applying non-maximum suppression.
-
SuppressNonMaximum
public SuppressNonMaximum() -
SuppressNonMaximum
public SuppressNonMaximum(SegmentStackIntoObjectsPooled<T> segment, ReduceElements<ObjectMask> reduce, boolean separateEachLabel) Creates a newSuppressNonMaximum
instance.- Parameters:
segment
- The segmentation algorithm that is applied as an input to non-maximum suppression.reduce
- The algorithm for reducing the number of object-masks.separateEachLabel
- If true, each label is reduced separately. if false, all labels are reduced together.
-
-
Method Details
-
createModelPool
public ConcurrentModelPool<T> createModelPool(ConcurrencyPlan plan, Logger logger) throws CreateModelFailedException Description copied from class:SegmentStackIntoObjectsPooled
Creates the model pool (to be used by multiple threads).- Specified by:
createModelPool
in classSegmentStackIntoObjectsPooled<T extends InferenceModel>
- Parameters:
plan
- the number and types of processors available for concurrent execution.logger
- the logger.- Returns:
- the newly created model pool.
- Throws:
CreateModelFailedException
- if a model cannot be created.
-
segment
public SegmentedObjects segment(Stack stack, ConcurrentModelPool<T> modelPool, ExecutionTimeRecorder executionTimeRecorder) throws SegmentationFailedException Description copied from class:SegmentStackIntoObjectsPooled
Segments a stack to produce an object-collection.Any created objects will always exist inside the stack's
Extent
.- Specified by:
segment
in classSegmentStackIntoObjectsPooled<T extends InferenceModel>
- Parameters:
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.- Returns:
- a collection of objects with corresponding confidence scores.
- Throws:
SegmentationFailedException
- if anything goes wrong during the segmentation.
-
getSegment
The segmentation algorithm that is applied as an input to non-maximum suppression. -
setSegment
The segmentation algorithm that is applied as an input to non-maximum suppression. -
getReduce
The algorithm for reducing the number of object-masks. -
setReduce
The algorithm for reducing the number of object-masks. -
isSeparateEachLabel
public boolean isSeparateEachLabel()If true, each label is reduced separately. if false, all labels are reduced together. -
setSeparateEachLabel
public void setSeparateEachLabel(boolean separateEachLabel) If true, each label is reduced separately. if false, all labels are reduced together.
-