Class DjlAutoConfiguration


  • @Configuration
    @ConditionalOnMissingBean(ai.djl.repository.zoo.ZooModel.class)
    @EnableConfigurationProperties(DjlConfigurationProperties.class)
    public class DjlAutoConfiguration
    extends Object
    • Constructor Detail

      • DjlAutoConfiguration

        public DjlAutoConfiguration()
    • Method Detail

      • imageFactory

        @Bean
        public ai.djl.modality.cv.ImageFactory imageFactory()
        Image factory is a convenience mechanism to create images from various resources like input streams, files, etc. that could be then used with the predictor for inference.
        Returns:
        instance of the ImageFactory
      • model

        @Bean
        public ai.djl.repository.zoo.ZooModel<?,​?> model()
                                                        throws ai.djl.MalformedModelException,
                                                               ai.djl.repository.zoo.ModelNotFoundException,
                                                               IOException
        Throws:
        ai.djl.MalformedModelException
        ai.djl.repository.zoo.ModelNotFoundException
        IOException
      • predictorProvider

        @Bean
        public Supplier<ai.djl.inference.Predictor<?,​?>> predictorProvider​(ai.djl.repository.zoo.ZooModel<?,​?> model)
        Expected to be used with try-with-resources. The provided predictor is AutoCloseable.
        Parameters:
        model - injected configured model
        Returns:
        provider of the predictor object