public class SegmentObjectsFromONNXModel extends SegmentStackIntoObjectsScaleDecode<ai.onnxruntime.OnnxTensor,OnnxModel>
.onnx
model file.Constructor and Description |
---|
SegmentObjectsFromONNXModel() |
Modifier and Type | Method and Description |
---|---|
ConcurrentModelPool<OnnxModel> |
createModelPool(ConcurrencyPlan plan,
Logger logger)
Creates the model pool (to be used by multiple threads).
|
protected ai.onnxruntime.OnnxTensor |
deriveInput(Stack stack,
Optional<double[]> subtractMeans)
Derives the input tensor from an image.
|
String |
getInputName()
The name of the input in the ONNX model.
|
String |
getModelPath()
Relative-path to the model file in ONNX form, relative to the models/ directory in the
Anchor distribution.
|
protected Optional<String> |
inputName()
The name of the tensor in the model which the input-image is mapped to.
|
boolean |
isIncludeBatchDimension()
If true, a 4-dimensional tensor is created (with the first dimension describing a batch-size
of 1), instead of the usual 3-dimensional tensor describing channel, height, width.
|
boolean |
isInterleaveChannels()
If true, the channels are placed as the final position of the tensor (**after** width/height)
instead of **before** width/height.
|
boolean |
isReadFromResources()
When true, rather than reading
modelPath from the file-system, it is read from Java
resources on the class-path. |
void |
setIncludeBatchDimension(boolean includeBatchDimension)
If true, a 4-dimensional tensor is created (with the first dimension describing a batch-size
of 1), instead of the usual 3-dimensional tensor describing channel, height, width.
|
void |
setInputName(String inputName)
The name of the input in the ONNX model.
|
void |
setInterleaveChannels(boolean interleaveChannels)
If true, the channels are placed as the final position of the tensor (**after** width/height)
instead of **before** width/height.
|
void |
setModelPath(String modelPath)
Relative-path to the model file in ONNX form, relative to the models/ directory in the
Anchor distribution.
|
void |
setReadFromResources(boolean readFromResources)
When true, rather than reading
modelPath from the file-system, it is read from Java
resources on the class-path. |
getClassLabelsPath, getDecode, getDisplayer, getInterpolator, getScaleInput, getSubtractMean, segment, setClassLabelsPath, setDecode, setDisplayer, setInterpolator, setScaleInput, setSubtractMean
resolve, segment
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public ConcurrentModelPool<OnnxModel> createModelPool(ConcurrencyPlan plan, Logger logger) throws CreateModelFailedException
SegmentStackIntoObjectsPooled
createModelPool
in class SegmentStackIntoObjectsPooled<OnnxModel>
plan
- the number and types of processors available for concurrent execution.logger
- the logger.CreateModelFailedException
- if a model cannot be created.protected ai.onnxruntime.OnnxTensor deriveInput(Stack stack, Optional<double[]> subtractMeans) throws OperationFailedException
SegmentStackIntoObjectsScaleDecode
deriveInput
in class SegmentStackIntoObjectsScaleDecode<ai.onnxruntime.OnnxTensor,OnnxModel>
stack
- the image which is mapped into an input tensor.subtractMeans
- respective intensity values that are subtracted from the voxels before
being added to the tensor (respectively for each channel).OperationFailedException
- if an input tensor cannot be created.protected Optional<String> inputName()
SegmentStackIntoObjectsScaleDecode
inputName
in class SegmentStackIntoObjectsScaleDecode<ai.onnxruntime.OnnxTensor,OnnxModel>
public String getModelPath()
If readFromResources==true
, it is read instead from resources on the class-path.
public void setModelPath(String modelPath)
If readFromResources==true
, it is read instead from resources on the class-path.
public boolean isReadFromResources()
modelPath
from the file-system, it is read from Java
resources on the class-path.public void setReadFromResources(boolean readFromResources)
modelPath
from the file-system, it is read from Java
resources on the class-path.public String getInputName()
public void setInputName(String inputName)
public boolean isIncludeBatchDimension()
public void setIncludeBatchDimension(boolean includeBatchDimension)
public boolean isInterleaveChannels()
Consequently, in terms of raw order in a FloatBuffer
, RGB values become
interleaved.
public void setInterleaveChannels(boolean interleaveChannels)
Consequently, in terms of raw order in a FloatBuffer
, RGB values become
interleaved.
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.