Class StyleTransferTranslator

java.lang.Object
ai.djl.modality.cv.translator.StyleTransferTranslator
All Implemented Interfaces:
NoBatchifyTranslator<Image,Image>, PostProcessor<Image>, PreProcessor<Image>, Translator<Image,Image>

public class StyleTransferTranslator extends Object implements NoBatchifyTranslator<Image,Image>
Built-in Translator that provides preprocessing and postprocessing for StyleTransfer.
  • Constructor Details

    • StyleTransferTranslator

      public StyleTransferTranslator()
  • Method Details

    • processInput

      public NDList processInput(TranslatorContext ctx, Image input)
      Processes the input and converts it to NDList.
      Specified by:
      processInput in interface PreProcessor<Image>
      Parameters:
      ctx - the toolkit for creating the input NDArray
      input - the input object
      Returns:
      the NDList after pre-processing
    • processOutput

      public Image processOutput(TranslatorContext ctx, NDList list)
      Processes the output NDList to the corresponding output object.
      Specified by:
      processOutput in interface PostProcessor<Image>
      Parameters:
      ctx - the toolkit used for post-processing
      list - the output NDList after inference, usually immutable in engines like PyTorch. @see Issue 1774
      Returns:
      the output object of expected type