public class DL4JInceptionV3Net extends Object implements ObjectRecogniser
DL4JInceptionV3Net is an implementation of ObjectRecogniser.
This object recogniser is powered by Deeplearning4j.
This implementation is pre configured to use
Google's InceptionV3 model pre trained on
ImageNet corpus. The models references in default settings are originally trained and exported
from Keras and imported using DL4J's importer tools.
Although this implementation is made to work out of the box without user attention, for advances users who are interested in tweaking the settings, the following fields are configurable:
ObjectRecogniser,
ObjectRecognitionParser,
TensorflowImageRecParser,
TensorflowRESTRecogniser| Constructor and Description |
|---|
DL4JInceptionV3Net() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkInitialization(InitializableProblemHandler problemHandler) |
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
|
Map<Integer,String> |
loadClassIndex(InputStream stream)
Loads the class to
|
org.nd4j.linalg.api.ndarray.INDArray |
preProcessImage(org.nd4j.linalg.api.ndarray.INDArray input)
Pre process image to reduce to make it feedable to inception network
|
List<RecognisedObject> |
recognise(InputStream stream,
ContentHandler handler,
Metadata metadata,
ParseContext context)
Recognise the objects in the stream
|
public Set<MediaType> getSupportedMimes()
ObjectRecognisergetSupportedMimes in interface ObjectRecogniserpublic void initialize(Map<String,Param> params) throws TikaConfigException
ObjectRecogniserinitialize in interface Initializableinitialize in interface ObjectRecogniserparams - configuration instance in the form of contextTikaConfigException - when there is an issue with configurationpublic void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
checkInitialization in interface InitializableproblemHandler - if there is a problem and no
custom initializableProblemHandler has been configured
via Initializable parameters,
this is called to respond.TikaConfigExceptionpublic boolean isAvailable()
ObjectRecogniserisAvailable in interface ObjectRecognisertrue when the service is available, false otherwisepublic org.nd4j.linalg.api.ndarray.INDArray preProcessImage(org.nd4j.linalg.api.ndarray.INDArray input)
input - Input imagepublic Map<Integer,String> loadClassIndex(InputStream stream) throws IOException, org.json.simple.parser.ParseException
stream - label index streamIOException - when the stream breaks unexpectedlyorg.json.simple.parser.ParseException - when the input doesn't contain a valid JSON mappublic List<RecognisedObject> recognise(InputStream stream, ContentHandler handler, Metadata metadata, ParseContext context) throws IOException, SAXException, TikaException
ObjectRecogniserrecognise in interface ObjectRecogniserstream - content streamhandler - tika's content handlermetadata - metadata instancecontext - parser contextRecognisedObjectsIOException - when an I/O error occursSAXException - when an issue with XML occursTikaException - any generic errorCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.