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<Image,T> translator)
Creates a
FileTranslator instance. |
| Modifier and Type | Method and Description |
|---|---|
Batchifier |
getBatchifier()
Gets the
Batchifier. |
void |
prepare(NDManager manager,
Model model)
Prepares the translator with the manager and model to use.
|
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, waitgetPipelinepublic FileTranslator(Translator<Image,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 outputpublic Batchifier getBatchifier()
Batchifier.getBatchifier in interface Translator<java.nio.file.Path,T>Batchifierpublic void prepare(NDManager manager, Model model) throws java.io.IOException
prepare in interface Translator<java.nio.file.Path,T>manager - the manager for the translatormodel - the model to translate forjava.io.IOException - if there is an error reading inputs for preparing the translator