Export labels

When you export your annotations from Labelbox, you will get a JSON payload containing the annotations for each asset in your dataset. Due to size, exports for video projects will contain a URL for each video that links to an NDJSON file containing the annotations for that video. More on retrieving video annotations here.

To export your annotations via the Labelbox UI, follow these steps:

  1. Select a project.

  2. Go to the Export tab.

  3. Select the date range you want to export over. This is based on label created date.

  4. Click the Generate export button.

  5. Download your generated export from the Tasks dropdown. At any time, you can click the bell icon at the top to view your most recent exports. If you would like to generate the same export again you'll have to refresh the page.

Label output format

For more details on the label export for each data type, please refer to the Label export article.

Python SDK

labels = project.label_generator()

## Alternatively you can specify date range to export desired labels from a project
labels = project.label_generator(start="2020-01-01", end="2020-01-02")

for label in labels:
  print(label.annotations)

Python Tutorial

Github

Google Colab

Image annotation export

Open in Github

Open in Google Colab

Text annotation export

Open in Github

Open in Google Colab

Video annotation export

Open in Github

Open in Google Colab

Retrieving video and DICOM annotations

API

To access the URL containing the information for the labeled frames, place your API key in the authorization header.

The endpoint this URL points to may return an HTTP 301 response. If this happens, the HTTP response will contain a Location header with the download URL. Each element in the NDJSON file represents each labeled frame in the video or DICOM file (unlabeled frames will not be included).

If the label is skipped and has no data, the endpoint will return an HTTP 204 response.

Bash example

curl -L -H "Authorization: Bearer $API_KEY"  $FRAMES_URL > $FRAMES_FILE_LOCATION

Python example

import requests

headers = {'Authorization': f"Bearer {API_KEY}"}
ndjson_response = requests.get(frames_url, headers=headers)

Postman

You can also access your video annotations using the Postman UI.

Steps:

  1. Open Postman and create a new basic API request.

  2. Copy the URL for frames and paste it as the request URL.

  3. Go to the Headers tab.

  4. Select Authorization as the key.

  5. Paste your API key as the Authorization value.

  6. Click Send.


What’s Next

Click the link below to view the label payload.

Did this page help you?