Package ai.djl.translate
Class Pipeline
- java.lang.Object
-
- ai.djl.translate.Pipeline
-
public class Pipeline extends java.lang.ObjectPipelineallows applying multiple transforms on an inputNDList.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pipelineadd(int index, Transform transform)Pipelineadd(Transform transform)Pipelineadd(java.lang.String name, Transform transform)Pipelineinsert(int position, int index, Transform transform)Pipelineinsert(int position, Transform transform)Inserts the givenTransformto the list of transforms at the given position.Pipelineinsert(int position, java.lang.String name, Transform transform)NDListtransform(NDList input)Applies the transforms configured in this object on the inputNDList.
-
-
-
Constructor Detail
-
Pipeline
public Pipeline()
Creates a new instance ofPipelinethat has noTransformdefined yet.
-
Pipeline
public Pipeline(Transform... transforms)
Creates a new instance ofPipelinethat 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
NDListwhen thetransformmethod is called on this object.- Parameters:
transforms- the transforms to be applied when thetransformmethod is called on this object
-
-
Method Detail
-
add
public Pipeline add(Transform transform)
Adds the givenTransformto the list of transforms to be applied on the input when thetransformmethod 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- theTransformto be added- Returns:
- this
Pipeline
-
insert
public Pipeline insert(int position, Transform transform)
Inserts the givenTransformto 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 inputNDListwhen thetransformmethod is called on this object.- Parameters:
position- the position at which theTransformmust be insertedtransform- theTransformto be inserted- Returns:
- this
Pipeline
-
-