What is the Amazon Rekognition API?
Amazon Rekognition is a computer vision api created by Amazon. Powered by an advanced AI, it can recognise and detect a lot of objects in images. It can detect faces, recognise celebrities and even read text visible in photos. This API is very useful when combined with WPSOLR. Images and text can then both be used when searching your website.
Create a user with Amazon Rekognition access
Log in to your AWS account.
Then search for iam in the search bar at the top. Click on “IAM” in Services.
Next, select “Users” in “Access management”, then add a user.
Choose a Username then select the “Programmatic access” checkbox.
Select “Add user to group” and if one doesn’t already exist, click on “Create group”.
Choose a group name and type in rekognition user in the second search bar. Click on the “AmazonRekognitionFullAccess” checkbox.
Click on “Next: tags” after creating your group.
You can just leave this field blank.
Click on “Create user”.
You should see this page after creating the user.
Create an index
Click on “Connect your indexes” in WPSOLR admin, then choose one of the two options. Since i am on a test environment, i will select “Click to generate a free index to test WPSOLR”.
Select “Create a free test index”. Then click “Save”.
Activate the WPSOLR Vision API extension
Go to “Activate extensions” and click on “Text, Image, Video AI” in the sidebar. Click on “Activate the AI extension” and save your options.
Configure the Amazon Rekognition API
Then click on the “Add an AI step” button and fill in the fields that appear. Add a name in the “Label” field then click on the “Activate” checkbox. Choose Amazon Rekognition in the “Provider” section. and then choose one of the options in the “provider’s service” dropdown list. they each provide a difference service like celebrity detection or labels detection.
Next enter the AWS access key and the secret access key from earlier. Enter a region and a minimum confidence threshold. if you have a problem with your search filters later, you may need to change you minimum confidence threshold to a 0(zero). Choose the index you want the settings to apply to, and the type of content which will be affected by it. You can choose “Media” so amazon will process your photos or “Posts”. If you choose the second option the photos in your posts will be processed by the API whether they be featured images, images or even photos from external websites that are linked to your posts.
If you press on the “Add an AI step” button again you can add another configuration for a service in Amazon Rekognition. When you’re done, save your changes.
Configure the WPSOLR search
Select “Define your search with ‘Test index from Elastic Cloud'”, then “Presentation” and click on the “search” checkbox. Then save your changes.
Configure the Amazon Comprehend fields to index
Select “Data” in the sidebar, then click on “Media”.
Choose the type of content you want to index. The media type supported are jpeg, jpg and png.
Choose the fields corresponding to the services you chose earlier.
Configure the Amazon Rekognition fields to use as filters
click on “Filter” in the sidebar and select the filters you wish to display.
Add WPSOLR facets widget to your search sidebar
Add the WPSOLR facets widget
Create a post with some interesting text to extract
Create an index
Select “Send your data” at the top, then click on “Index selected post types in index ‘your_index_name'”.