From f36f941f49b072d4624ba552318b6c96ab77c495 Mon Sep 17 00:00:00 2001 From: Mingshi Liu Date: Fri, 20 Dec 2024 18:20:23 -0800 Subject: [PATCH] add tutorials for amazon rekognition Signed-off-by: Mingshi Liu --- .../amazon_rekognition_connector_blueprint.md | 259 ++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 docs/remote_inference_blueprints/amazon_rekognition_connector_blueprint.md diff --git a/docs/remote_inference_blueprints/amazon_rekognition_connector_blueprint.md b/docs/remote_inference_blueprints/amazon_rekognition_connector_blueprint.md new file mode 100644 index 0000000000..f6e212ec37 --- /dev/null +++ b/docs/remote_inference_blueprints/amazon_rekognition_connector_blueprint.md @@ -0,0 +1,259 @@ +# Amazon Rekognition Detect Text connector blueprint + +Amazon Rekognition is a computer vision service that can analyze images and videos. This tutorial shows how to create an OpenSearch connector for Amazon Rekognition's Detect Text API, which can detect and extract text from images. + +## Detect text with DetectText API + +This tutorial demonstrates how to create an OpenSearch connector for an Amazon Rekognition model that detects text in images using the DetectText API. + +Note: This functionality is available in OpenSearch 2.14 or later. + +### Step 1: Add the connector endpoint to trusted URLs +```json +PUT /_cluster/settings +{ + "persistent": { + "plugins.ml_commons.trusted_connector_endpoints_regex": [ + "^https://rekognition\\..*[a-z0-9-]\\.amazonaws\\.com$" + ] + } +} +``` + + +### Step 2: Create a connector for Amazon Rekognition +```json +POST /_plugins/_ml/connectors/_create +{ + "name": "rekognition: detect text", + "description": "my test connector", + "version": "1.0", + "protocol": "aws_sigv4", + "credential": { + "access_key": "your_access_key", + "secret_key": "your_secret_key", + "session_token": "your_session_token" + }, + "parameters": { + "region": "us-west-2", + "service_name": "rekognition" + }, + "actions": [ + { + "action_type": "predict", + "method": "POST", + "headers": { + "content-type": "application/x-amz-json-1.1", + "X-Amz-Target": "RekognitionService.DetectText" + }, + "url": "https://${parameters.service_name}.${parameters.region}.amazonaws.com", + "request_body": "{ \"Image\": { \"Bytes\": \"${parameters.image_bytes}\" } } " + } + ] +} +``` +Sample response: +```json +{ + "connector_id": "o52l5pMB6Ebhud5_ypxu" +} +``` + +### Step 3: Register the model +```json +POST /_plugins/_ml/models/_register +{ + "name": "Amazon Rekoginition detect text model", + "version": "1.0", + "function_name": "remote", + "description": "test model", + "connector_id": "o52l5pMB6Ebhud5_ypxu" +} +``` +Sample response: +```json +{ + "task_id": "pZ2n5pMB6Ebhud5_n5yK", + "status": "CREATED", + "model_id": "pp2n5pMB6Ebhud5_oJwF" +} +``` + +### Step 4: Deploy the model +```json +POST /_plugins/_ml/models/pp2n5pMB6Ebhud5_oJwF/_deploy +``` +Sample response: +```json +{ + "task_id": "p52o5pMB6Ebhud5_dpyL", + "task_type": "DEPLOY_MODEL", + "status": "COMPLETED" +} +``` + +### Step 5: Test the model inference +```json +POST _plugins/_ml/models/pp2n5pMB6Ebhud5_oJwF/_predict +{ + "parameters": { + "response_filter": "$.TextDetections.*.DetectedText", + "image_bytes": "iVBORw0KGgoAAAANSUhEUgAAASEAAAA/CAYAAACvtn5EAAABV2lDQ1BJQ0MgUHJvZmlsZQAAKJF1kD1Iw1AUhU80UlGRSh1ELGRwsFKLtBnsWDuoIBir4g8uaVqTQhMfSfybdXQWRycXNxHqIjg6uYg/OIijuApdtMT7TDWt4oXL/Tgc7jvvAi2iylhZBGBarp2bGJeWllek0AtERNFOcr+qOSyjKNPE+J7NVb2DwOfNCN/1eoK92MzsdTiaNiOnxu1ff1N1FIqORvODelhjtgsIQ8TKlss4bxP32hSKeJ+z7vMR57zPZ1+e+VyW+Io4rBlqgfiBOJ5v0PUGNssbWj0DT99VtBbmaHZTDyCLFGRMYgxpUIJ/vHLduw6GHdgoQYcBFxIypDCUUSSeggUNCcSJkxillvmNf98u0IwnWr1KT+0GWqkPOE/QN3sCbfAZiGwCF4dMtdWfiwpV0VlLJX3urABtB573tgiEYkDt3vPeK55XOwZaH4HL6idn9WB5HFNo1wAAAFZlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA5KGAAcAAAASAAA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B2CoI/E/8cbOaMZv3Ws+n1MAdu8tr5bBMwl4CosMU/ge8NKBHY1/1H3kRsMfShlFtGqnj9qoberEOSD3Ayp4KgtCmMaC1+w4rIureIpgXOD5NRHZ9dsyeJy2684eApRgCNMC9hXVhTqyxLHKWB/HknO3Kmaeg+3B1CiqYxbJVjvIix0MxiezORai40B8fr7HKqQ9uqj0JCPWdYZcU4ljKQRFQAsf0sAgTYk8LTFXAX1gDlNs6II14rvBsmh4ilpAeKBZQhzWWUAGrkuIWEPjH+gM0l9dWYTnEhM7NjVPnForYLQkrqvG8GVaAaxMBWGg5olUjeqtDiN3q1UOxtZaQkJAeqBdQh5BQAQHUqTjcWKxvQiC/IO6cTs1RauBCY90S1nnhQWVtvZCedeitS0hIb0SfgT4hoWcAslTxzBCwloTsE2F8ZqcrFQkCgkBxR0BIqLhfQWm/IFDMERASKuYXUJovCBR3BISEivsVlPYLAsUcASGhYn4BpfmCQHFHQEioCFxBPFcnIgg8DwjY0peFhIrAlXfk57FEBIHnAQFb+rKQUBG48s5lDP8tpAg0RZogCBQIAVv6spBQgSDXpzDeb1PBxbq3COhTs2gRBPRDAH3Y0ruacqtJ/IDckHnGx8vyk994SPTOvQeUwUv1s3J5cdYzbpZUJwhYRAAxILhgsIBsISAol2fHLEIsiYKAIGBvBMQdszfCol8QEAQsIiAkZBEeSRQEBAF7IyAkZG+ERb8gIAhYREBIyCI8kigICAL2RkBIyN4Ii35BQBCwiICQkEV4JFEQEATsjYCQkL0RFv2CgCBgEQEhIYvwSKIgIAjYGwEhIXsjLPoFAUHAIgJCQhbhkURBQBCwNwL/AedZ9yFiupMfAAAAAElFTkSuQmCC" + } +} +``` + +Sample response: +```json +{ + "inference_results": [ + { + "output": [ + { + "name": "response", + "dataAsMap": { + "response": [ + "Platform", + "Search for anything", + "Platform", + "Search", + "for", + "anything" + ] + } + } + ], + "status_code": 200 + } + ] +} +``` + +### Step 6: Create an ingest pipeline with an ml_inference processor + +- The ML inference processor passes a source field to a model, extracts the model output, and inserts it into a target field. + +- This example processor works as follows: + + - [1] Extracts values from the image field and passes the values to the image_bytes parameter. + - [2] Invokes the Amazon Rekognition DetectText API providing the image_bytes parameter. + - [3] Extracts values from the DetectText API response with JSON path. + - [4] Inserts the extracted values into the text field. + - [5] Removes the original image field. + + +```json +PUT _ingest/pipeline/rekognition_detect_text_pipeline +{ + "description": "Test rekognition detect text", + "processors": [ + { + "ml_inference": { + "model_id": "pp2n5pMB6Ebhud5_oJwF", + "input_map": [ + { + "image_bytes": "image" + } + ], + "output_map": [ + { + "text": "$.TextDetections.*.DetectedText" + } + ] + } + }, + { + "remove": { + "field": "image" + } + } + ] +} +``` + +Sample response: +```json +{ + "acknowledged": true +} +``` + +Step 7: Create an index with the ingest pipeline + +Create an index that uses the ingest pipeline by default: + +```json +PUT detect_text_test +{ + "settings": { + "index": { + "default_pipeline": "rekognition_detect_text_pipeline" + } + } +} +``` + +Sample response: +```json +{ + "acknowledged": true, + "shards_acknowledged": true, + "index": "detect_text_test" +} +``` + +Step 8: Test the ingest pipeline + +Let's test the pipeline by indexing a document with an image: + +```json +PUT detect_text_test/_doc/1 +{ + "image": "iVBORw0KGgoAAAANSUhEUgAAASEAAAA/CAYAAACvtn5EAAABV2lDQ1BJQ0MgUHJvZmlsZQAAKJF1kD1Iw1AUhU80UlGRSh1ELGRwsFKLtBnsWDuoIBir4g8uaVqTQhMfSfybdXQWRycXNxHqIjg6uYg/OIijuApdtMT7TDWt4oXL/Tgc7jvvAi2iylhZBGBarp2bGJeWllek0AtERNFOcr+qOSyjKNPE+J7NVb2DwOfNCN/1eoK92MzsdTiaNiOnxu1ff1N1FIqORvODelhjtgsIQ8TKlss4bxP32hSKeJ+z7vMR57zPZ1+e+VyW+Io4rBlqgfiBOJ5v0PUGNssbWj0DT99VtBbmaHZTDyCLFGRMYgxpUIJ/vHLduw6GHdgoQYcBFxIypDCUUSSeggUNCcSJkxillvmNf98u0IwnWr1KT+0GWqkPOE/QN3sCbfAZiGwCF4dMt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gIXbHTPjgQCWn/AMMvaK6yZaRabt616dszmWqSgRQSseXYMwWItTmNOKUYuzFZVdC5DTjn+IybcKjxak/O4OT05j+FRC8SIKrFexA/sIVi3w82zinxytgMxpnIc6wGB2CoI/E/8cbOaMZv3Ws+n1MAdu8tr5bBMwl4CosMU/ge8NKBHY1/1H3kRsMfShlFtGqnj9qoberEOSD3Ayp4KgtCmMaC1+w4rIureIpgXOD5NRHZ9dsyeJy2684eApRgCNMC9hXVhTqyxLHKWB/HknO3Kmaeg+3B1CiqYxbJVjvIix0MxiezORai40B8fr7HKqQ9uqj0JCPWdYZcU4ljKQRFQAsf0sAgTYk8LTFXAX1gDlNs6II14rvBsmh4ilpAeKBZQhzWWUAGrkuIWEPjH+gM0l9dWYTnEhM7NjVPnForYLQkrqvG8GVaAaxMBWGg5olUjeqtDiN3q1UOxtZaQkJAeqBdQh5BQAQHUqTjcWKxvQiC/IO6cTs1RauBCY90S1nnhQWVtvZCedeitS0hIb0SfgT4hoWcAslTxzBCwloTsE2F8ZqcrFQkCgkBxR0BIqLhfQWm/IFDMERASKuYXUJovCBR3BISEivsVlPYLAsUcASGhYn4BpfmCQHFHQEioCFxBPFcnIgg8DwjY0peFhIrAlXfk57FEBIHnAQFb+rKQUBG48s5lDP8tpAg0RZogCBQIAVv6spBQgSDXpzDeb1PBxbq3COhTs2gRBPRDAH3Y0ruacqtJ/IDckHnGx8vyk994SPTOvQeUwUv1s3J5cdYzbpZUJwhYRAAxILhgsIBsISAol2fHLEIsiYKAIGBvBMQdszfCol8QEAQsIiAkZBEeSRQEBAF7IyAkZG+ERb8gIAhYREBIyCI8kigICAL2RkBIyN4Ii35BQBCwiICQkEV4JFEQEATsjYCQkL0RFv2CgCBgEQEhIYvwSKIgIAjYGwEhIXsjLPoFAUHAIgJCQhbhkURBQBCwNwL/AedZ9yFiupMfAAAAAElFTkSuQmCC" +} +``` + +Sample response: +```json +{ + "_index": "detect_text_test", + "_id": "1", + "_version": 1, + "result": "created", + "_shards": { + "total": 2, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1 +} + +``` +Let's get the indexed document and check if the extracted texts are showing under the `text` field`: + +```json +GET detect_text_test/_doc/1 +``` +Sample response: + +```json +{ + "_index": "detect_text_test", + "_id": "1", + "_version": 1, + "_seq_no": 0, + "_primary_term": 1, + "found": true, + "_source": { + "text": [ + "Platform", + "Search for anything", + "Platform", + "Search", + "for", + "anything" + ] + } +} +``` \ No newline at end of file