public class DecodeMaskRCNN extends DecodeInstanceSegmentation<ai.onnxruntime.OnnxTensor>
It is designed to work with accompanying MaskRCNN-10.onnx
in resources, which expects
an image of size 1088x800 (width x height) and may throw an error if the input-size is different
than this.
The ONNX file was obtained from this GitHub source, which also describes its inputs and outputs.
This issue may also be relevant: it mentions an error message that occurs when a different sized input to the above is used.
Constructor and Description |
---|
DecodeMaskRCNN() |
Modifier and Type | Method and Description |
---|---|
List<LabelledWithConfidence<MultiScaleObject>> |
decode(List<ai.onnxruntime.OnnxTensor> inferenceOutput,
ImageInferenceContext context)
Decodes the output tensors from inference into
ObjectMask s with confidence and
labels. |
List<String> |
expectedOutputs()
Ordered names of the tensors we are interested in processing, as outputted from inference.
|
Interpolator |
getInterpolator()
The interpolator to use for scaling images.
|
float |
getMinConfidence()
Only proposals outputted from the model with a score greater or equal to this threshold are
considered.
|
float |
getMinMaskValue()
Only voxels with a value greater or equal to this threshold are considered as part of the
mask.
|
void |
setInterpolator(Interpolator interpolator)
The interpolator to use for scaling images.
|
void |
setMinConfidence(float minConfidence)
Only proposals outputted from the model with a score greater or equal to this threshold are
considered.
|
void |
setMinMaskValue(float minMaskValue)
Only voxels with a value greater or equal to this threshold are considered as part of the
mask.
|
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public List<String> expectedOutputs()
DecodeInstanceSegmentation
expectedOutputs
in class DecodeInstanceSegmentation<ai.onnxruntime.OnnxTensor>
public List<LabelledWithConfidence<MultiScaleObject>> decode(List<ai.onnxruntime.OnnxTensor> inferenceOutput, ImageInferenceContext context) throws OperationFailedException
DecodeInstanceSegmentation
ObjectMask
s with confidence and
labels.
The created ObjectMask
s should match unscaledDimensions
in size.
decode
in class DecodeInstanceSegmentation<ai.onnxruntime.OnnxTensor>
inferenceOutput
- the tensors that are the result of the inference.context
- the context in which the inference is occurring.unscaledDimensions
in size.OperationFailedException
- if it cannot be decoded successfully.public float getMinConfidence()
public void setMinConfidence(float minConfidence)
public float getMinMaskValue()
public void setMinMaskValue(float minMaskValue)
public Interpolator getInterpolator()
public void setInterpolator(Interpolator interpolator)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.