Package ai.djl.modality.cv.translator
Class BigGANTranslator
- java.lang.Object
-
- ai.djl.modality.cv.translator.BigGANTranslator
-
- All Implemented Interfaces:
NoBatchifyTranslator<int[],Image[]>,PostProcessor<Image[]>,PreProcessor<int[]>,Translator<int[],Image[]>
public final class BigGANTranslator extends java.lang.Object implements NoBatchifyTranslator<int[],Image[]>
Built-inTranslatorthat provides preprocessing and postprocessing for BigGAN.
-
-
Constructor Summary
Constructors Constructor Description BigGANTranslator(float truncation)Constructs a translator for BigGAN.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NDListprocessInput(TranslatorContext ctx, int[] input)Processes the input and converts it to NDList.Image[]processOutput(TranslatorContext ctx, NDList list)Processes the output NDList to the corresponding output object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ai.djl.translate.NoBatchifyTranslator
getBatchifier
-
Methods inherited from interface ai.djl.translate.Translator
getExpansions, prepare, toBatchTranslator, toBatchTranslator
-
-
-
-
Method Detail
-
processOutput
public Image[] processOutput(TranslatorContext ctx, NDList list)
Processes the output NDList to the corresponding output object.- Specified by:
processOutputin interfacePostProcessor<Image[]>- Parameters:
ctx- the toolkit used for post-processinglist- the output NDList after inference, usually immutable in engines like PyTorch. @see Issue 1774- Returns:
- the output object of expected type
-
processInput
public NDList processInput(TranslatorContext ctx, int[] input) throws java.lang.Exception
Processes the input and converts it to NDList.- Specified by:
processInputin interfacePreProcessor<int[]>- Parameters:
ctx- the toolkit for creating the input NDArrayinput- the input object- Returns:
- the
NDListafter pre-processing - Throws:
java.lang.Exception- if an error occurs during processing input
-
-