Export as Python Annotation Types

Open In Colab Open a Colab to go through the exercise of exporting video annotations.
label_generator = project.label_generator()

# You can iterate thru the paginated labels from generator
label = next(label_generator)

# View some specific fields of the label instance
print("Label ID:", label.uid)
print("Created By:", label.extra['Created By'])
print("Created At:", label.extra['Created At'])
print("Media Type:", label.extra['media_type'])
print("Reviews:", label.extra['Reviews'])

# You can convert to a LabelList for small to medium-sized datasets.
# This is more convenient than the LabelGenerator, but less memory efficient. Read more about the differences here.
labels = labels.as_list()

Export as JSON

labels = project.export_labels(download=True)

# Optionally, provide a date range as an optional parameter
# This will export only labels created between the supplied dates
# Date range can be formatted as "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"
labels = project.export_labels(download=True, start="2022-09-28", end="2022-10-04")

Annotation export formats

Bounding box

{
    "featureId": "ck9bmeej61emf0yf5bgjb4tjw",
    "schemaId": "ck9blmq1lnlxw08895jy7zsk4",
    "title": "Car 1",
    "value": "car_1",
    "color": "#1CE6FF",
    "keyframe": false,
    "bbox": {
        "top": 1164,
        "left": 2538,
        "height": 222,
        "width": 119
    }
}

Segment

segments = [{
    "keyframes": [{
        "frame": 1,
        "bbox": {
            "top": 80,
            "left": 80,
            "height": 80,
            "width": 80
        }
    }, {
        "frame": 20,
        "bbox": {
            "top": 125,
            "left": 125,
            "height": 200,
            "width": 300
        }
    }]
}, {
    "keyframes": [{
        "frame": 27,
        "bbox": {
            "top": 80,
            "left": 50,
            "height": 80,
            "width": 50
        }
    }]
}]

Point

{
    "featureId": "ckmv0r56g00023g68s2dgru6l",
    "schemaId": "cklifp8jw0tn40y5p3xtr2kk2",
    "title": "right_ear",
    "value": "right_ear",
    "color": "#1CE6FF",
    "keyframe": true,
    "point": {
        "x": 943,
        "y": 500
}

Polyline

{
    "featureId": "ckt37btlp00063h6b8srqrsr8",
    "schemaId": "ckt09rb8q7zsu0yc24y3w85m5",
    "title": "Center lane",
    "value": "center_lane",
    "color": "#2f05f1",
    "keyframe": true,
    "line": [{
            "x": 661.215,
            "y": 2146.298
        },
        {
            "x": 961.767,
            "y": 1907.624
        },
        {
            "x": 1262.32,
            "y": 1668.95
        }
    ],
    "classifications": []
}

Mask

{
    "featureId": "ck9bmetz800340za5k073bm7w",
    "schemaId": "ck9blmq1lnlxz08892qqlmxto",
    "title": "Defect",
    "value": "defect",
    "color": "#FFD7D2",
    "keyframe": "true",
    "instanceURI": "https://api.labelbox.com/masks/feature/ckmuuw2tq00053g68rbwjpoim?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjazUycnZ4MWtxYXpiMDc3MDBtcTI3eDRsIiwib3JnYW5pemF0aW9uSWQiOiJjazUycnZ4MG1wdzRnMDc2NndncXZqdGw5IiwiaWF0IjoxNjE3MDM4NDAwLCJleHAiOjE2MTk2MzA0MDB9.5YaORL6mWpPqgAb6IbWChm4MQo14obOU8LFWbfCEHR0"
}

Classification - Radio

// For global classifications, do not include the frames section
{
   "schemaId": "ckd1295hc00640z0uapvm1xbd",  // question schema id
   "uuid": "fb72782d-f6ed-43ba-8677-77b03197392d",
   "dataRow": {
       "id": "ckd1299m8cqbs0cq43mju1bvp"
    },
    "answer": {
        "schemaId": "ckd1295jn00760z0u01hw4yz5" // answer schema id
    },
    "frames": [
        {
            "start": 7,
            "end": 13,
        },
        {
            "start": 18,
            "end": 19,
        }
    ]
}

Classification - Checklist

[
  {
    "frameNumber": 1,
    "classifications": [
      {
        "featureId": "cl89b9sjb00003b6keuil18qx",
        "schemaId": "cl89b9kwz11yj070nhmnscwj4",
        "title": "Signs in frame",
        "value": "signs_in_frame",
        "answers": [
          {
            "featureId": "cl89b9sjb00013b6kvxfa6gmj",
            "schemaId": "cl89b9kwz11yk070na20ngv31",
            "title": "Stop",
            "value": "stop",
            "keyframe": true
          },
          {
            "featureId": "cl89b9tq000023b6ke9jh90ym",
            "schemaId": "cl89b9kwz11ym070nbr0m7qbs",
            "title": "Yield",
            "value": "yield",
            "keyframe": true
          }
        ]
      }
    ],
    "objects": [],
    "relationships": []
  },
  {
    "frameNumber": 2,
    "classifications": [
      {
        "featureId": "cl89b9sjb00003b6keuil18qx",
        "schemaId": "cl89b9kwz11yj070nhmnscwj4",
        "title": "Signs in frame",
        "value": "signs_in_frame",
        "answers": [
          {
            "featureId": "cl89b9sjb00013b6kvxfa6gmj",
            "schemaId": "cl89b9kwz11yk070na20ngv31",
            "title": "Stop",
            "value": "stop",
            "keyframe": false
          },
          {
            "featureId": "cl89b9tq000023b6ke9jh90ym",
            "schemaId": "cl89b9kwz11ym070nbr0m7qbs",
            "title": "Yield",
            "value": "yield",
            "keyframe": false
          }
        ]
      }
    ],
    "objects": [],
    "relationships": []
  }
]

Sample Label payload - Video

[
    {
        "ID": "cknp36mns00033g68sqqsq844",
        "DataRow ID": "cklifdz2e1yf10rco407yaita",
        "Labeled Data": "https://storage.labelbox.com/ck52rvx0mpw4g0766wgqvjtl9%2F98c62818-8aad-2da8-aa86-141fb32742f4-lioness_walking.mp4?Expires=1620075890645&KeyName=labelbox-assets-key-3&Signature=Es1jENXKqKPt4nShF89ASvVmLzE",
        "Label": {
            "frames": "https://api.labelbox.com/v1/frames/cknp36mns00033g68sqqsq844"
        },
        "Created By": "[email protected]",
        "Project Name": "Lioness walking",
        "Created At": "2021-04-19T21:04:38.000Z",
        "Updated At": "2021-04-19T21:04:45.000Z",
        "Seconds to Label": 20,
        "External ID": "lioness_walking.mp4",
        "Agreement": -1,
        "Benchmark Agreement": -1,
        "Benchmark ID": null,
        "Dataset Name": "lioness_walking",
        "Reviews": [],
        "View Label": "https://editor.labelbox.com?project=cklifeflvf7dx0795p3rzpa6g&label=cknp36mns00033g68sqqsq844",
        "Has Open Issues": 0,
        "Skipped": false,
        "DataRow Workflow Info": {
            "taskName": "Done",
            "Workflow History": [
              {
                "actorId": "cl3lobugu14pw0796fau0dgad",
                "action": "APPROVE",
                "createdAt": "2022-09-29T15:46:23.269Z",
                "previousTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "previousTaskName": "Initial review task"
              },
              {
                "actorId": "cl3lobugu14pw0796fau0dgad",
                "action": "REWORK",
                "createdAt": "2022-09-29T14:23:59.735Z",
                "previousTaskId": "4a0d7f40-0c3f-0cc8-adc4-fd818684facd",
                "previousTaskName": "Rework (all rejected)",
                "nextTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "nextTaskName": "Initial review task"
              },
              {
                "actorId": "cl1qe5naj3g460z6e0owr6mwj",
                "action": "REJECT",
                "createdAt": "2022-09-29T13:39:01.077Z",
                "previousTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "previousTaskName": "Initial review task",
                "nextTaskId": "4a0d7f40-0c3f-0cc8-adc4-fd818684facd",
                "nextTaskName": "Rework (all rejected)"
              },
              {
                "actorId": "cl3ucfsj22j8l073xaitnh1xe",
                "action": "MOVE",
                "createdAt": "2022-09-28T18:06:16.881Z",
                "previousTaskId": "ea78e526-e429-002e-8b80-b72c4b591152",
                "previousTaskName": "Initial labeling task",
                "nextTaskId": "0ae49522-97f0-4a07-96c6-bd4d50963acd",
                "nextTaskName": "Initial review task"
              },
              {
                "actorId": "cl3ucfsj22j8l073xaitnh1xe",
                "action": "MOVE",
                "createdAt": "2022-09-28T18:06:16.859Z",
                "nextTaskId": "ea78e526-e429-002e-8b80-b72c4b591152",
                "nextTaskName": "Initial labeling task"
              }
            ]
        }
    }
]

// Access per-frame annotation info via Label.frames URL (see above)
{
    "frameNumber": 1,
    "classifications": [
        {
            "featureId": "ckmvaolhj2f2p0y8h7it0gpb2",
            "schemaId": "ckmvaijzd2elz0y8h06ribh9b",
            "title": "Is it daytime?",
            "value": "is_it_daytime?",
            "answer": {
                "featureId": "ckmvaq6p3000c3g68vlqkjo18",
                "schemaId": "ckmvaik0p2eml0y8h12z632kq",
                "title": "Yes",
                "value": "yes",
                "keyframe": true
            }
        }
    ],
    "objects": [
        {
            "featureId": "ckmvapiqw00083g688yjpvd34",
            "schemaId": "cklifp8jw0tn40y5p3xtr2kk2",
            "title": "right_ear",
            "value": "right_ear",
            "color": "#1CE6FF",
            "keyframe": true,
            "point": {
                "x": 1447,
                "y": 430
            },
            "classifications": [
                {
                    "featureId": "ckmvaplfj00093g68elakf0q2",
                    "schemaId": "cklifp8ly0tnu0y5pd2jrcams",
                    "title": "Visibility",
                    "value": "visibility",
                    "answer": {
                        "featureId": "ckmvaplfj000a3g68rax7qw9k",
                        "schemaId": "cklifp8n20to80y5p6pyo0jyu",
                        "title": "0",
                        "value": "0",
                        "keyframe": true
                    }
                }
            ]
        },
        {
            "featureId": "ckmvaqsco000g3g681txq5v8h",
            "schemaId": "ckmvaobyl20s70y8u13eu6nmc",
            "title": "Lion",
            "value": "lion",
            "color": "#997D87",
            "keyframe": true,
            "bbox": {
                "top": 366,
                "left": 557,
                "height": 571,
                "width": 977
            },
            "classifications": [
                {
                    "featureId": "ckmvaqvbc000h3g68i6d37w8y",
                    "schemaId": "ckmvaoc0120si0y8uang3hwza",
                    "title": "Is the lion walking?",
                    "value": "is_the_lion_walking?",
                    "answer": {
                        "featureId": "ckmvaqvbd000i3g68z4c3i78s",
                        "schemaId": "ckmvaoc1s20tb0y8ub1p79fl8",
                        "title": "No",
                        "value": "no",
                        "keyframe": true
                    }
                }
            ]
        }
    ]
}