AWSTextract是否支持扫描驾照和护照?
创始人
2024-09-27 15:30:06
0

AWS Textract支持扫描驾照和护照。需要注意的是,扫描的结果将以文本形式返回,不包含图像或照片。

以下是使用AWS CLI在Python中调用AWS Textract扫描护照的示例代码:

import boto3
import io
from PIL import Image

# Replace bucket, document, and region with your values
bucket = 'my-bucket'
document = 'passport.jpg'
region = 'us-east-1'

# Get the document from S3
s3 = boto3.resource('s3', region_name=region)
object = s3.Object(bucket, document)
image = object.get()['Body'].read()

# Analyze the document
client = boto3.client('textract', region_name=region)
response = client.analyze_document(Document={'Bytes': image}, FeatureTypes=['FORMS'])

# Print the fields
for field in response['Blocks']:
    if field['BlockType'] == 'KEY_VALUE_SET':
        if 'KEY' in field.keys() and field['KEY']['Text'] == 'Place of Issue':
            print('Place of Issue:', field['VALUE']['Text'])

以上代码将解析包含护照扫描的S3对象,并从扫描结果中提取包含“Place of Issue”值的字段。

相关内容

热门资讯

wepokeai机器人(透视)... wepokeai机器人(透视)wepoke有没有玄学(详细辅助新2025版)确实是有挂(可靠辅助德之...
wepoke模拟器(透视)we... wepoke模拟器(透视)wepoke软件透明功能实现方法(详细辅助教你教程)好像是真的有挂(科普插...
wepoke辅助德之星(透视)... wepoke辅助德之星(透视)wepooke app系统规律(详细辅助攻略方法)真是是有挂(教你有辅...
wepoke有辅助挂(透视)w... wepoke有辅助挂(透视)wepoke有辅助挂吗(详细辅助科技教程)一直是有挂(教你透视挂)1、让...
wepoke辅助有挂(透视)w... wepoke辅助有挂(透视)wepoke人有挂吗(详细辅助可靠技巧)其实有挂(了解辅助)1.wepo...
wepoke插件(透视)wep... wepoke插件(透视)wepoke软件收费是真的吗(详细辅助辅助教程)其实真的是有挂(专业模拟器)...
wepoke辅助德之星(透视)... wepoke辅助德之星(透视)wopoker辅助(详细辅助新2025教程)真是真的有挂(玩家ai机器...
we辅助poker德之星(透视... we辅助poker德之星(透视)wepoke辅助挂在哪开(详细辅助新2025版)确实是真的有挂(大神...
wepoke黑科技(透视)we... wepoke黑科技(透视)wepoke挂真的假的(详细辅助揭秘攻略)竟然存在有挂(攻略计算辅助)1、...
wepoke智能ai(透视)w... wepoke智能ai(透视)wepower让系统发好牌(详细辅助教你攻略)真是真的有挂(详细有挂)1...