public class ImageTransformer extends Object implements ExampleTransformer
ONNX expects images in the format [channels,height,width].
Constructor and Description |
---|
ImageTransformer(int channels,
int height,
int width) |
Modifier and Type | Method and Description |
---|---|
com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance |
getProvenance() |
void |
postConfig()
Used by the OLCUT configuration system, and should not be called by external code.
|
String |
toString() |
ai.onnxruntime.OnnxTensor |
transform(ai.onnxruntime.OrtEnvironment env,
List<SparseVector> vectors)
Converts a list of
SparseVector s representing a batch of features into a OnnxTensor . |
ai.onnxruntime.OnnxTensor |
transform(ai.onnxruntime.OrtEnvironment env,
SparseVector vector)
Converts a
SparseVector representing the features into a OnnxTensor . |
public void postConfig()
postConfig
in interface com.oracle.labs.mlrg.olcut.config.Configurable
public ai.onnxruntime.OnnxTensor transform(ai.onnxruntime.OrtEnvironment env, SparseVector vector) throws ai.onnxruntime.OrtException
ExampleTransformer
SparseVector
representing the features into a OnnxTensor
.
It generates it as a single example minibatch.
transform
in interface ExampleTransformer
env
- The OrtEnvironment to create the tensor in.vector
- The features to convert.ai.onnxruntime.OrtException
- if the transformation failed.public ai.onnxruntime.OnnxTensor transform(ai.onnxruntime.OrtEnvironment env, List<SparseVector> vectors) throws ai.onnxruntime.OrtException
ExampleTransformer
SparseVector
s representing a batch of features into a OnnxTensor
.transform
in interface ExampleTransformer
env
- The OrtEnvironment to create the tensor in.vectors
- The batch of features to convert.ai.onnxruntime.OrtException
- if the transformation failed.public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()
getProvenance
in interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.