Class TensorflowRESTCaptioner
- java.lang.Object
- 
- org.apache.tika.parser.captioning.tf.TensorflowRESTCaptioner
 
- 
- All Implemented Interfaces:
- 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 SummaryConstructors Constructor Description TensorflowRESTCaptioner()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckInitialization(InitializableProblemHandler handler)protected URIgetApiUri(Metadata metadata)Set<MediaType>getSupportedMimes()The mimes supported by this recogniservoidinitialize(Map<String,Param> params)This is the hook for configuring the recogniserbooleanisAvailable()Is this service availableList<CaptionObject>recognise(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)Recognise the objects in the stream
 
- 
- 
- 
Method Detail- 
getSupportedMimespublic Set<MediaType> getSupportedMimes() Description copied from interface:ObjectRecogniserThe mimes supported by this recogniser- Specified by:
- getSupportedMimesin interface- ObjectRecogniser
- Returns:
- set of mediatypes
 
 - 
isAvailablepublic boolean isAvailable() Description copied from interface:ObjectRecogniserIs this service available- Specified by:
- isAvailablein interface- ObjectRecogniser
- Returns:
- truewhen the service is available,- falseotherwise
 
 - 
initializepublic void initialize(Map<String,Param> params) throws TikaConfigException Description copied from interface:ObjectRecogniserThis is the hook for configuring the recogniser- Specified by:
- initializein interface- Initializable
- Specified by:
- initializein interface- ObjectRecogniser
- Parameters:
- params- configuration instance in the form of context
- Throws:
- TikaConfigException- when there is an issue with configuration
 
 - 
checkInitializationpublic void checkInitialization(InitializableProblemHandler handler) throws TikaConfigException - Specified by:
- checkInitializationin interface- Initializable
- Parameters:
- handler- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.
- Throws:
- TikaConfigException
 
 - 
recognisepublic List<CaptionObject> recognise(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException Description copied from interface:ObjectRecogniserRecognise the objects in the stream- Specified by:
- recognisein interface- ObjectRecogniser
- Parameters:
- stream- content stream
- handler- tika's content handler
- metadata- metadata instance
- context- parser context
- Returns:
- List of RecognisedObjects
- Throws:
- IOException- when an I/O error occurs
- SAXException- when an issue with XML occurs
- TikaException- any generic error
 
 
- 
 
-