T
- the output object typepublic class FileTranslator<T> extends java.lang.Object implements Translator<java.nio.file.Path,T>
Translator
that provides image pre-processing from file path.Constructor and Description |
---|
FileTranslator(Translator<java.awt.image.BufferedImage,T> translator)
Creates a
FileTranslator instance. |
Modifier and Type | Method and Description |
---|---|
NDList |
processInput(TranslatorContext ctx,
java.nio.file.Path input)
Processes the input and converts it to NDList.
|
T |
processOutput(TranslatorContext ctx,
NDList list)
Processes the output NDList to the corresponding output object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBatchifier, prepare
getPipeline
public FileTranslator(Translator<java.awt.image.BufferedImage,T> translator)
FileTranslator
instance.translator
- a Translator
that can process imagepublic NDList processInput(TranslatorContext ctx, java.nio.file.Path input) throws java.lang.Exception
processInput
in interface PreProcessor<java.nio.file.Path>
ctx
- the toolkit for creating the input NDArrayinput
- the input objectNDList
after pre-processingjava.lang.Exception
- if an error occurs during processing inputpublic T processOutput(TranslatorContext ctx, NDList list) throws java.lang.Exception
processOutput
in interface PostProcessor<T>
ctx
- the toolkit used for post-processinglist
- the output NDList after inferencejava.lang.Exception
- if an error occurs during processing output