在windows命令行下输入:aws rekognition index-faces --image '{"S3Object":{"Bucket":"face-collection-1","Name":"0008.jpg"}}' --collection-id "student" --detection-attributes "ALL" --region us-east-1
出现错误:
Error parsing parameter '--image': Expected: '=', received: ''' for input:
'{S3Object:{Bucket:face-collection-1,Name:0008.jpg}}'
^
这是由于windows命令行本身的特点而产生的问题
方法一:
在双引号前加转义字符
aws rekognition index-faces --image ""{\"S3Object\":{\"Bucket\":\"face-collection-1\",\"Name\":\"0008.jpg\"}}"" --collection-id "student" --detection-attributes "ALL" --region us-east-1
方法二:
用三个双引号代替单个双引号
aws rekognition index-faces --image ""{"""S3Object""":{"""Bucket""":"""face-collection-1""","""Name""":"""0008.jpg"""}}"" --collection-id "student" --detection-attributes "ALL" --region us-east-1