Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon s3 Amazon Rekognition API-索引面提示外部图像id错误-当';外部图像ID';里面有文件夹结构_Amazon S3_Amazon_Amazon Rekognition - Fatal编程技术网

Amazon s3 Amazon Rekognition API-索引面提示外部图像id错误-当';外部图像ID';里面有文件夹结构

Amazon s3 Amazon Rekognition API-索引面提示外部图像id错误-当';外部图像ID';里面有文件夹结构,amazon-s3,amazon,amazon-rekognition,Amazon S3,Amazon,Amazon Rekognition,我试图调用IndexFaces API,但出现错误: *"exception":"com.amazonaws.services.rekognition.model.AmazonRekognitionException", "message": "1 validation error detected: Value 'postman/postworld/postman_female.jpg' at 'externalImageId' failed to satisfy constraint: Me

我试图调用IndexFaces API,但出现错误:

*"exception":"com.amazonaws.services.rekognition.model.AmazonRekognitionException",
"message": "1 validation error detected: Value 'postman/postworld/postman_female.jpg' at 'externalImageId' failed to satisfy constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9_.\\-:]+ (Service: AmazonRekognition; Status Code: 400; Error Code: ValidationException; Request ID: 3ac46c4d-3358-11e8-abd5-d5fb3ad03e33)",
"path": "/enrolluser"*
我能够使用S3的所谓“文件夹结构”成功地将文件上传到S3中。但是,当我试图读取同一个文件的索引面时,它会提示一个与“externalimageid”相关的错误

以下是我上传文件的S3快照:

http://xxxxxx.s3.amazonaws.com/postman/postworld/postman_automated.jpg
如果我去掉文件夹结构并直接转储文件,如:

http://xxxxxx.s3.amazonaws.com/postman_automated.jpg
然后IndexFacesAPI将成功地传递它

当我有“文件夹结构”时,你能建议如何传递externalImageId吗?目前,我正在通过java代码传递ExternalImage ID,如下所示:

enrolledFileName = userName +"/"+myWorldName+"/"+enrolledFileName;
System.out.println("The FILE NAME MANIPULATED IS:"+enrolledFileName);
String generateAmazonFaceId = amazonRekognitionManagerObj.addToCollectionForEnrollment(collectionName, bucketName, enrolledFileName);
System.out.println("The Generated FaceId is:"+generateAmazonFaceId);**strong text**
上述代码内部调用:

Image image=new Image().withS3Object(new S3Object().withBucket(bucketName)
                              .withName(fileName));

 IndexFacesRequest indexFacesRequest = new IndexFacesRequest()
                  .withImage(image)
                  .withCollectionId(collectionName)
                  .withExternalImageId(fileName)
                  .withDetectionAttributes("ALL");

有什么建议/帮助吗?找到了解决方案。谢谢ExternalImage ID可以是任何字符串,并且不需要与文件名相同。所以我把它换成了另一根弦,它就像一个符咒。