技術雑記帳兼日記帳

AWS、Python、Terraformの使い方をコッソリ

Amazon Rekognition

python Amazon Rekognition Detect Text

はじめに 今回は画像からテキストを分析するDetect Textを使ってみる。 準備 下記のプログラムを用意する。 detect_text.py.py from PIL import Image, ImageDraw, ImageFont import boto3, sys, json, os, traceback #画像の分析結果を返す def detect_text…

python Amazon Rekognition Recognize Celebrities

はじめに 今回は有名人の顔を分析するRecognize Celebritiesを使ってみる。 準備 下記のプログラムを用意する。 recognize_celebrities.py import boto3, sys, json, cv2, math, os, traceback #recognize_celebritiesで顔の分析結果を返す def recognize_ce…

Amazon Rekognition Confidence値(信頼度)について

開発者ガイドより、 https://docs.aws.amazon.com/ja_jp/rekognition/latest/dg/rekognition-dg.pdf 引用 正確なラベルを必要とする場合は、信頼度の高い (95% 以上) ラベルに絞り込んで選択します。 信頼値がそれほど高くなくてもよい場合は、信頼値が低い …

python Amazon Rekognition detect_facesその2

はじめに detect_facesの結果を分析してBoundingBoxと顔のパーツの位置を埋め込む処理を実装した。 流石にカート・コバーンの画像を使うのは気が引けるので画像なしで。 準備 下記のプログラムを用意する。 detect_faces.py import boto3, sys, json, cv2, m…

python Amazon Rekognition detect_facesその1

はじめに Amazon Rekognitionでdetect_facesを使用してみる。 今回は書くことがないので短め 準備 下記の画像をdetect_facesで分析させる。 下記のプログラムを用意する。 detect_faces.py import boto3, sys, json if len(sys.argv) != 2: exit() client=bo…

python Amazon Rekognition detect_labelsその2

※若干プログラムを修正しました。 はじめに Amazon Rekognitionで分析した画像にBoundingBoxとラベルを表示させてみる。 準備 事前に下記の画像をAmazon Rekognitionで分析させてJsonファイルを取得しておく。 下記のプログラムを用意する。 detect_labels.p…

python Amazon Rekognition detect_labelsその1

はじめに Amazon Rekognitionを使用してみる。 Amazon Rekognitionは簡単に言えば画像分析サービス。 画像に有名人がいるかとか、その画像に含まれている要素は何なのかを判断してくれる ほかにも、文字認識もできる。 今回は画像のラベル検出(detect_labels…