Callback Format

Callback Format

{
  "response": {
    "annotations": {
        "url": "https://scaleapi-results.s3.amazonaws.com/5e5dc4a0-1d9b-11e8-bce8-41122de76216"
    },
    "events": {
        "url": "https://scaleapi-results.s3.amazonaws.com/5e5dc4a0-1d9b-11e8-bce8-41122de76217"
    }
  },
  "task_id": "582bfe0ee5d51cda4e903f4a",
  "task": {
    // populated task for convenience
    ...
  }
}
[
  {
    "annotations": {
      "26201bd9-72ab-4b63-ab7d-df4e671161b9": {
        "label": "Person",
        "geometry": "box",
        "frames": [
          {
            "key": 1,
            "left": 854,
            "top": 144,
            "height": 168,
            "width": 72,
            "attributes": {},
            "timestamp": 0.03
          },
          ...
        ]
      }
    }
  }
]

The response will be uploaded to Amazon S3 as a JSON.

The response object, which is part of the callback POST request and permanently stored as part of the task object, will have either an error field or a annotations and events field.

If the annotation was completed successfully, the annotations field will contain an dictionary of the annotated objects. Each key will be the annotation unique identifier (uuid) and it's value will have the following attributes:

  • label (if with_labels is true): The label for the annotation, which will be one of the specified task.params.geometries.
  • geometry: The geometry type of the annotation. For the moment, only box is supported.
  • frames: An array specifying annotation values throughout the video

Each frame will have the following format:

  • key: The frame number. The frame number (relative to the video). This may not be consecutive if provided annotation frame rate is less than the video frame rate. If the annotation frame rate does not divide the video frame rate evenly, the closest video frame is annotated. For example if the video frame rate is 29.92 and annotation frame rate is 5, then the first annotation has a key of (1/5 sec) * (29.92 fps) = 5.984 or 6th frame.
  • left: The distance, in pixels, between the left border of the bounding box and the left border of the image.
  • top: The distance, in pixels, between the top border of the bounding box and the top border of the image.
  • width: The width, in pixels, of the bounding box.
  • height: The height, in pixels, of the bounding box.
  • attributes: Annotation attributes in this specific frame. The value will contain attributes specified in task.params.annotation_attributes
  • timestamp: The timestamp of the frame within the video in seconds.