Package ai.djl.modality.cv.translator
Class BaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder>
- java.lang.Object
-
- ai.djl.modality.cv.translator.BaseImageTranslator.BaseBuilder<T>
-
- Type Parameters:
T
- the concrete builder type
- Direct Known Subclasses:
BaseImageTranslator.ClassificationBuilder
,SimplePoseTranslator.Builder
- Enclosing class:
- BaseImageTranslator<T>
public abstract static class BaseImageTranslator.BaseBuilder<T extends BaseImageTranslator.BaseBuilder> extends java.lang.Object
A builder to extend for all classes extending theBaseImageTranslator
.
-
-
Field Summary
Fields Modifier and Type Field Description protected Batchifier
batchifier
protected Image.Flag
flag
protected int
height
protected Pipeline
pipeline
protected int
width
-
Constructor Summary
Constructors Constructor Description BaseBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
addTransform(Transform transform)
protected void
configPostProcess(java.util.Map<java.lang.String,?> arguments)
protected void
configPreProcess(java.util.Map<java.lang.String,?> arguments)
T
optBatchifier(Batchifier batchifier)
Sets theBatchifier
for theTranslator
.T
optFlag(Image.Flag flag)
Sets the optionalImage.Flag
(default isImage.Flag.COLOR
).protected abstract T
self()
T
setPipeline(Pipeline pipeline)
Sets thePipeline
to use for pre-processing the image.protected void
validate()
-
-
-
Field Detail
-
width
protected int width
-
height
protected int height
-
flag
protected Image.Flag flag
-
pipeline
protected Pipeline pipeline
-
batchifier
protected Batchifier batchifier
-
-
Method Detail
-
optFlag
public T optFlag(Image.Flag flag)
Sets the optionalImage.Flag
(default isImage.Flag.COLOR
).- Parameters:
flag
- the color mode for the images- Returns:
- this builder
-
setPipeline
public T setPipeline(Pipeline pipeline)
Sets thePipeline
to use for pre-processing the image.- Parameters:
pipeline
- the pre-processing pipeline- Returns:
- this builder
-
addTransform
public T addTransform(Transform transform)
- Parameters:
transform
- theTransform
to be added- Returns:
- this builder
-
optBatchifier
public T optBatchifier(Batchifier batchifier)
Sets theBatchifier
for theTranslator
.- Parameters:
batchifier
- theBatchifier
to be set- Returns:
- this builder
-
self
protected abstract T self()
-
validate
protected void validate()
-
configPreProcess
protected void configPreProcess(java.util.Map<java.lang.String,?> arguments)
-
configPostProcess
protected void configPostProcess(java.util.Map<java.lang.String,?> arguments)
-
-