Class TensorflowRESTRecogniser
- java.lang.Object
-
- org.apache.tika.parser.recognition.tf.TensorflowRESTRecogniser
-
- All Implemented Interfaces:
Initializable
,ObjectRecogniser
- Direct Known Subclasses:
TensorflowRESTVideoRecogniser
public class TensorflowRESTRecogniser extends Object implements ObjectRecogniser
Tensor Flow image recogniser which has high performance. This implementation uses Tensorflow via REST API.NOTE : https://wiki.apache.org/tika/TikaAndVision
- Since:
- Apache Tika 1.14
-
-
Field Summary
Fields Modifier and Type Field Description protected URI
apiBaseUri
protected URI
apiUri
protected boolean
available
protected URI
healthUri
protected static String
LABEL_LANG
protected double
minConfidence
protected int
topN
-
Constructor Summary
Constructors Constructor Description TensorflowRESTRecogniser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkInitialization(InitializableProblemHandler handler)
protected URI
getApiUri(Metadata metadata)
Set<MediaType>
getSupportedMimes()
The mimes supported by this recogniservoid
initialize(Map<String,Param> params)
This is the hook for configuring the recogniserboolean
isAvailable()
Is this service availableList<RecognisedObject>
recognise(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context)
Recognise the objects in the stream
-
-
-
Method Detail
-
getSupportedMimes
public Set<MediaType> getSupportedMimes()
Description copied from interface:ObjectRecogniser
The mimes supported by this recogniser- Specified by:
getSupportedMimes
in interfaceObjectRecogniser
- Returns:
- set of mediatypes
-
isAvailable
public boolean isAvailable()
Description copied from interface:ObjectRecogniser
Is this service available- Specified by:
isAvailable
in interfaceObjectRecogniser
- Returns:
true
when the service is available,false
otherwise
-
initialize
public void initialize(Map<String,Param> params) throws TikaConfigException
Description copied from interface:ObjectRecogniser
This is the hook for configuring the recogniser- Specified by:
initialize
in interfaceInitializable
- Specified by:
initialize
in interfaceObjectRecogniser
- Parameters:
params
- configuration instance in the form of context- Throws:
TikaConfigException
- when there is an issue with configuration
-
checkInitialization
public void checkInitialization(InitializableProblemHandler handler) throws TikaConfigException
- Specified by:
checkInitialization
in interfaceInitializable
- Parameters:
handler
- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
recognise
public List<RecognisedObject> recognise(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException
Description copied from interface:ObjectRecogniser
Recognise the objects in the stream- Specified by:
recognise
in interfaceObjectRecogniser
- Parameters:
stream
- content streamhandler
- tika's content handlermetadata
- metadata instancecontext
- parser context- Returns:
- List of
RecognisedObject
s - Throws:
IOException
- when an I/O error occursSAXException
- when an issue with XML occursTikaException
- any generic error
-
-