AWS Rekognition:indexFaces 抛出正则表达式模式错误

AWS Rekognition : indexFaces throw regular expression pattern error

我正在研究 AWS 识别并最终遇到了一个非常常见的问题

1 validation error detected: Value 'mainbucket/xxxxx-xxx-xxx-xx-xxx/family' at 'image.s3Object.bucket' failed to satisfy constraint: Member must satisfy regular expression pattern: [0-9A-Za-z\.\-_]*"

代码[从文档中复制粘贴 - 除了使用我的 AWS 配置配置为 运行]

var params = {
    CollectionId: "collectionidnewbatch", 
    DetectionAttributes: [
    ], 
    ExternalImageId: "testphotoid", 
    Image: {
     S3Object: {
      Bucket: "mainbucket/xxxxx-xxx-xxx-xx-xxx/family",
      Name: "ab1.jpg"
     }
    }
   };
   rekognition.indexFaces(params, function(err, data) {
     if (err) console.log(err, err.stack); // an error occurred
     else     console.log(data); 
   });

我尝试在 Source 中提供嵌套的存储桶路径,但它无法识别 Source 密钥!而且我不确定如何在此请求中提供嵌套路径。

有线索吗?

存储桶名称不包含斜线。

如果对象在子目录中,则在 Name:

中包含完整路径
    Image: {
     S3Object: {
      Bucket: "mainbucket",
      Name: "xxxxx-xxx-xxx-xx-xxx/family/ab1.jpg"
     }
    }