public class TensorflowRESTRecogniser extends Object implements ObjectRecogniser
NOTE : https://wiki.apache.org/tika/TikaAndVision
Modifier and Type | Field and 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 and Description |
---|
TensorflowRESTRecogniser() |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialization(InitializableProblemHandler handler) |
protected URI |
getApiUri(Metadata metadata) |
Set<MediaType> |
getSupportedMimes()
The mimes supported by this recogniser
|
void |
initialize(Map<String,Param> params)
This is the hook for configuring the recogniser
|
boolean |
isAvailable()
Is this service available
|
List<RecognisedObject> |
recognise(InputStream stream,
ContentHandler handler,
Metadata metadata,
ParseContext context)
Recognise the objects in the stream
|
protected static final String LABEL_LANG
@Field protected int topN
@Field protected double minConfidence
protected URI apiUri
protected URI healthUri
protected boolean available
public Set<MediaType> getSupportedMimes()
ObjectRecogniser
getSupportedMimes
in interface ObjectRecogniser
public boolean isAvailable()
ObjectRecogniser
isAvailable
in interface ObjectRecogniser
true
when the service is available, false
otherwisepublic void initialize(Map<String,Param> params) throws TikaConfigException
ObjectRecogniser
initialize
in interface Initializable
initialize
in interface ObjectRecogniser
params
- configuration instance in the form of contextTikaConfigException
- when there is an issue with configurationpublic void checkInitialization(InitializableProblemHandler handler) throws TikaConfigException
checkInitialization
in interface Initializable
handler
- if there is a problem and no
custom initializableProblemHandler has been configured
via Initializable parameters,
this is called to respond.TikaConfigException
public List<RecognisedObject> recognise(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException
ObjectRecogniser
recognise
in interface ObjectRecogniser
stream
- content streamhandler
- tika's content handlermetadata
- metadata instancecontext
- parser contextRecognisedObject
sIOException
- when an I/O error occursSAXException
- when an issue with XML occursTikaException
- any generic errorCopyright © 2007–1969 The Apache Software Foundation. All rights reserved.