Package ai.djl.translate
Class Pipeline
- java.lang.Object
-
- ai.djl.translate.Pipeline
-
public class Pipeline extends java.lang.Object
Pipeline
allows applying multiple transforms on an inputNDList
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pipeline
add(int index, Transform transform)
Pipeline
add(Transform transform)
Pipeline
add(java.lang.String name, Transform transform)
Pipeline
insert(int position, int index, Transform transform)
Pipeline
insert(int position, Transform transform)
Inserts the givenTransform
to the list of transforms at the given position.Pipeline
insert(int position, java.lang.String name, Transform transform)
NDList
transform(NDList input)
Applies the transforms configured in this object on the inputNDList
.
-
-
-
Constructor Detail
-
Pipeline
public Pipeline()
Creates a new instance ofPipeline
that has noTransform
defined yet.
-
Pipeline
public Pipeline(Transform... transforms)
Creates a new instance ofPipeline
that can apply the given transforms on its input.Since no keys are provided for these transforms, they will be applied to the first element in the input
NDList
when thetransform
method is called on this object.- Parameters:
transforms
- the transforms to be applied when thetransform
method is called on this object
-
-
Method Detail
-
add
public Pipeline add(Transform transform)
Adds the givenTransform
to the list of transforms to be applied on the input when thetransform
method is called on this object.Since no keys are provided for this
Transform
, it will be applied to the first element in the inputNDList
.- Parameters:
transform
- theTransform
to be added- Returns:
- this
Pipeline
-
insert
public Pipeline insert(int position, Transform transform)
Inserts the givenTransform
to the list of transforms at the given position.Since no keys or indices are provided for this
Transform
, it will be applied to the first element in the inputNDList
when thetransform
method is called on this object.- Parameters:
position
- the position at which theTransform
must be insertedtransform
- theTransform
to be inserted- Returns:
- this
Pipeline
-
-