Rekognition get_text_detection not returning Timestamp with milliseconds precision

0

When submitting a video to Rekognition, get_text_detection is always returning Timestamp with seconds precision instead of milliseconds. For example:

text_detection: {'Timestamp': 4000, 'TextDetection': {'DetectedText': 'ITV Lunchtime News', 'Type': 'LINE', 'Id': 0, 'Confidence': 99.68327331542969, 'Geometry': {'BoundingBox': {'Width': 0.1505126953125, 'Height': 0.033203125, 'Left': 0.35760498046875, 'Top': 0.0947265625}, 'Polygon': [{'X': 0.35760498046875, 'Y': 0.0947265625}, {'X': 0.50811767578125, 'Y': 0.0947265625}, {'X': 0.50811767578125, 'Y': 0.1279296875}, {'X': 0.35760498046875, 'Y': 0.1279296875}]}}}

Code snippets:

response = self.rekognition.start_text_detection(
            Video=self.param_video,
            NotificationChannel=self.param_channel,
            JobTag=self.job_tag,
            Filters=self.param_filters,
        )
        self.job_id = response["JobId"]
while not finished:
            response = self.rekognition.get_text_detection(
                JobId=self.job_id, MaxResults=max_results, NextToken=pagination_token
            )

            for text_detection in response["TextDetections"]:
                print(f'text_detection: {text_detection}')
            if "NextToken" in response:
                pagination_token = response["NextToken"]
            else:
                finished = True

Looks like a bug to me. But it's weird that I didn't find anyone reporting it before. So am I doing something wrong?

已提問 2 年前檢視次數 267 次
1 個回答
0

Hi,

Thank you for pointing this out.

Rekognition Video StartTextDetection apis do not analyze all the frames in the video and may choose to select frames to analyze based on internal algorithms. As a result, you may not see output for all frames.

We have also noticed that in some cases, the output timestamp may not represent a frame with a given PTS. We will work on making this more accurate. As a workaround, to map the output timestamp to a frame in the video, we recommend selecting the frame closest to the output timestamp from the video.

Thanks.

AWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南