This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE VIEW myview AS | |
SELECT DISTINCT | |
"image-db"."labels"."source" | |
, "image-db"."labels"."name" | |
, "image-db"."labels"."parents_0_name" "parent_category" | |
, "image-db"."labels"."parents_1_name" "sub_category" | |
, "image-db"."labels"."confidence" "label_confidence" | |
, "image-db"."text"."detectedtext" | |
, "image-db"."text"."type" | |
, "image-db"."text"."id" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Records": [ | |
{ | |
"eventVersion": "2.1", | |
"eventSource": "aws:s3", | |
"awsRegion": "eu-west-2", | |
"eventTime": "2020-06-17T13:38:46.701Z", | |
"eventName": "ObjectCreated:Put", | |
"userIdentity": { | |
"principalId": "A7UQA2IM60E06" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import boto3 | |
import os | |
#from flatten_json import flatten | |
s3=boto3.resource('s3') | |
target_bucket='<your TARGET bucket name here>' # please update with the S3 bucket you will be sending files to | |
# Amazon Rekognition | |
def detect_labels(source_image, bucket): | |
client=boto3.client('rekognition') |