Class TensorflowRESTCaptioner

  • All Implemented Interfaces:
    org.apache.tika.config.Initializable, ObjectRecogniser

    public class TensorflowRESTCaptioner
    extends Object
    implements ObjectRecogniser
    Tensorflow image captioner. This implementation uses Tensorflow via REST API.

    NOTE : https://wiki.apache.org/tika/ImageCaption

    Since:
    Apache Tika 1.17
    • Constructor Detail

      • TensorflowRESTCaptioner

        public TensorflowRESTCaptioner()
    • Method Detail

      • getApiUri

        protected URI getApiUri​(org.apache.tika.metadata.Metadata metadata)
      • getSupportedMimes

        public Set<org.apache.tika.mime.MediaType> getSupportedMimes()
        Description copied from interface: ObjectRecogniser
        The mimes supported by this recogniser
        Specified by:
        getSupportedMimes in interface ObjectRecogniser
        Returns:
        set of mediatypes
      • isAvailable

        public boolean isAvailable()
        Description copied from interface: ObjectRecogniser
        Is this service available
        Specified by:
        isAvailable in interface ObjectRecogniser
        Returns:
        true when the service is available, false otherwise
      • initialize

        public void initialize​(Map<String,​org.apache.tika.config.Param> params)
                        throws org.apache.tika.exception.TikaConfigException
        Description copied from interface: ObjectRecogniser
        This is the hook for configuring the recogniser
        Specified by:
        initialize in interface org.apache.tika.config.Initializable
        Specified by:
        initialize in interface ObjectRecogniser
        Parameters:
        params - configuration instance in the form of context
        Throws:
        org.apache.tika.exception.TikaConfigException - when there is an issue with configuration
      • checkInitialization

        public void checkInitialization​(org.apache.tika.config.InitializableProblemHandler handler)
                                 throws org.apache.tika.exception.TikaConfigException
        Specified by:
        checkInitialization in interface org.apache.tika.config.Initializable
        Throws:
        org.apache.tika.exception.TikaConfigException