Custom Post Annotation Lambda Function for Custom Labeling Job

0

Hello,

I have implemented a post annotation lambda function for my sagemaker ground truth custom job.

After the annotations are finished, the results come after the consolidation of the annotations are saved in a subdirectory called "iteration_X" of "annotations/consolidated-annotation/consolidation-response/".

However, the outcome of the annotations is never successful and from the log of the lambda function used for the post annotation I always receive this type of error:

{
    "labeling-job-name": "labeling-job-full-dataset-test-giusy-10",
    "event-name": "ANNOTATION_CONSOLIDATION_LAMBDA_SCHEMA_MATCHING_FAILED",
    "event-log-message": "ERROR: Annotation consolidation Lambda response did not match expected data format for line 1."
}

Based on this guide (https://docs.aws.amazon.com/id_id/sagemaker/latest/dg/sms-custom-templates-step3-lambda-requirements.html) I made sure that my lambda function returns:

RESPONSE:


[
  {
    "datasetObjectId": "1",
    "consolidatedAnnotation": {
      "content": {
        "annotations": {
          "relations": [
            {
              "subj": "CW",
              "predicate": "adjust",
              "obj": "key"
            },
            {
              "subj": "key",
              "predicate": "with",
              "obj": "right_hand"
            },
            {
              "subj": "key",
              "predicate": "on",
              "obj": "lock"
            }
          ],
          "groundings": {
            "pre_frame": [
              {
                "object": "right_hand",
                "left": 776.5,
                "top": 219.5,
                "width": 282.52,
                "height": 246.5
              },
              {
                "object": "lock",
                "left": 716.4,
                "top": 255.6,
                "width": 93.60000000000002,
                "height": 111.6
              }
            ],
            "pnr_frame": [
              {
                "object": "right_hand",
                "left": 974.16,
                "top": 275.14,
                "width": 287.21,
                "height": 215.84
              },
              {
                "object": "lock",
                "left": 914.4,
                "top": 291.6,
                "width": 97.20000000000005,
                "height": 90
              }
            ],
            "post_frame": [
              {
                "object": "right_hand",
                "left": 858.58,
                "top": 240.54,
                "width": 316.28,
                "height": 209.37
              },
              {
                "object": "lock",
                "left": 741.6,
                "top": 237.6,
                "width": 61.19999999999993,
                "height": 169.20000000000002
              }
            ]
          },
          "timestamp": "0",
          "clip_uid": "undefined"
        }
      }
    }
  }
]

I can't figure out how to avoid this type of error and make the annotations go through when the job is finished.

2 Antworten
0

It may be possible that ground truth is attempting to read the result from the annotations/consolidated-annotation/ directory and thus not actually reading the consolidated response but the file containing them

beantwortet vor 2 Jahren
0

inside the lambda function method I'm reading from the data from: "annotations/consolidated-annotation/consolidation-request/" because it contains all the data necessary for the desired response.

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen