Magnolia 6.0 reached end of life on June 26, 2019. This branch is no longer supported, see End-of-life policy.
The Image Recognition module searches for untagged images, recognizes and tags them via either a local pre-trained neural network or an external image recognition service. The module also provides the integration of the image recognition feature with content tags.
artifactID | Description |
---|---|
| Parent reactor. |
| Provides a functionality to integrate content tags and the image recognition service using decorations. |
| Provides an API to recognize images. |
| Provides the image recognition module and service. |
| Provides a functionality to recognize images via Amazon Rekognition. |
Maven is the easiest way to install the modules. Add the following dependencies to your webapp. All the other necessary dependencies will be brought in automatically:
<dependency>
<groupId>info.magnolia.ai.image</groupId>
<artifactId>magnolia-image-recognition</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.magnolia.ai.image</groupId>
<artifactId>magnolia-content-tags-integration</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.magnolia.ai.image</groupId>
<artifactId>magnolia-image-recognition-api</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.magnolia.ai.image</groupId>
<artifactId>magnolia-amazon-image-recognition</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>info.magnolia.ai.image</groupId>
<artifactId>magnolia-local-image-recognition</artifactId>
<version>1.2.5</version>
</dependency>
Libraries for Amazon Rekognition
Your running instance should contain the latest version available of the following JARs:
http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-rekognition/
You can use the magnolia-local-image-recognition
module, which provides a functionality to recognize images locally via a pre-trained neural network based on:
This is an independent module offered as an add-on for EE users.
artifactID | Description |
---|---|
| Provides a functionality to recognize images locally via a pre-trained neural network. |
Maven is the easiest way to install the module. Add the following dependency to your webapp. All the other necessary dependencies will be brought in automatically:
<dependency>
<groupId>info.magnolia.ai.image</groupId>
<artifactId>magnolia-local-image-recognition</artifactId>
<version>1.2.5</version>
</dependency>
In the module configuration you can:
minConfidence
property for the local recognition serviceIn the configuration of the image-recognition
you can define which recognition service should be used. Define the service as the value of the class
property under the /modules/image-recognition/currentImageRecognitionService
node:
Property | Description |
---|---|
class | required, default is Specifies which service should be used for image recognition. The default value doesn't recognize images, it is just a placeholder. Other values:
|
For recognition confidence of the Amazon Rekognition service, see Image recognition via Amazon Rekognition: Configuration options.
For recognition confidence of the local image recognizer, set it with the minConfidence
property under /modules/local-image-recognition/config
.
Property | Description |
---|---|
minConfidence | optional, default is The confidence score of recognition. An integer value between 0-100. The filter drops the tags with confidence lower than the value of this property. Setting the value higher usually results in fewer image results, but a higher confidence that the image is recognized accurately. |
Image recognition can be a very intensive process in terms of CPU resources. One of the functions of our implementation of image recognition is that the recognition process can be delegated to several parallel threads. With more threads working you can obtain the results faster.
You can specify the number of parallel image recognition threads for the image recognition service provided by the image-recognition-api
submodule. Set the number in the
magnolia.properties
configuration file through a Magnolia property called magnolia.image.recognition.thread
.
For example, magnolia.image.recognition.thread=3
enables three recognition threads. If the property is not set in the file, the default number of threads used by the system is five.
You can implement another image recognition service or integrate your app with another third-party image recognition service using the info.magnolia.ai.image.ImageRecogniser
interface provided by the image-recognition-api
submodule:
/** * Takes image bytes as parameter and returns a {@link Collection collection} * of {@link ImageLabel Image label}s as output. * * <p> * Returns empty collection for the cases below: * <li>Upon exception</li> * <li>Image couldn't be recognised</li> * </p> */ Collection<ImageLabel> recognise(byte[] imageBytes);
For general usage information, see the Image recognition page.