AWS Rekognition FaceSearch - 没有作业完成通知

AWS Rekognition FaceSearch - no notification of job completion

有没有人成功完成面部搜索?

我在 2018 年 8 月 13 日东部时间上午 8 点左右使用 .Net API 提交了人脸搜索,但我的队列尚未收到工作完成的通知。来自 StartFaceSearch 的响应的 HttpStatusCode 是:OK

我有一个队列订阅了我请求接收通知的主题。我向主题发布了一条测试消息,队列确实接收了它。

这是代码...(已编辑标识符)

            // upload the video to Amazon
            IAmazonS3 client = new AmazonS3Client();
            // 1. Put object-specify only key name for the new object.
            var putRequest1 = new PutObjectRequest
            {
                BucketName = "mybucket.com",
                Key = dr["video_id"].ToString(),
                FilePath = Path.Combine(videoPath, dr["video_path"].ToString()),
                ContentType = "video/mp4"
            };
            PutObjectResponse response1 = await client.PutObjectAsync(putRequest1);

            // upload the image to Amazon
            byte[] image = (byte[])(dr["photobinary"]);
            MemoryStream stream = new MemoryStream(image);

            using (Amazon.S3.Transfer.TransferUtility tranUtility =
              new Amazon.S3.Transfer.TransferUtility(client))
            {
                tranUtility.Upload(stream, "bucket.com", dr["SSN"].ToString());
            }
            stream.Close();

            // create a Rekognition Collection
            IAmazonRekognition rekClient = new AmazonRekognitionClient();

            try
            {
                // try to delete in case it already exists
                rekClient.DeleteCollection(new DeleteCollectionRequest
                {
                    CollectionId = dr["ssn"].ToString()
                });
            }
            catch { }

            var response = rekClient.CreateCollection(new CreateCollectionRequest
            {
                CollectionId = dr["ssn"].ToString()
            });

            string collectionArn = response.CollectionArn;
            int statusCode = response.StatusCode;

            var facesResponse = rekClient.IndexFaces(new IndexFacesRequest
            {
                CollectionId = dr["ssn"].ToString(),
                DetectionAttributes = new List<string>
                {

                },
                ExternalImageId = dr["ssn"].ToString(),
                Image = new Image
                {
                    S3Object = new Amazon.Rekognition.Model.S3Object
                    {
                        Bucket = "bucket.com",
                        Name = dr["ssn"].ToString()
                    }
                }
            });

            List<FaceRecord> faceRecords = facesResponse.FaceRecords;
            string orientationCorrection = facesResponse.OrientationCorrection;

            var faceSearchResponse = rekClient.StartFaceSearch(new StartFaceSearchRequest
            {
                CollectionId = dr["ssn"].ToString(),
                Video = new Video
                {
                    S3Object = new Amazon.Rekognition.Model.S3Object
                    {
                        Bucket = "videobucket.com",
                        Name = dr["video_id"].ToString()
                    }
                },
                NotificationChannel = new NotificationChannel
                {
                    SNSTopicArn = "arn:xxx",
                    RoleArn = "arn:xxx"
                }
            });

问题是我指定的角色没有适当的权限来写入主题。我授予角色管理员访问权限,它开始工作了。