Skip to main content
The most common method for importing data to Labelbox is via Python SDK after setting up a cloud storage integration. With an IAM delegated access integration, you can keep your data in your cloud bucket and grant Labelbox limited access to the data on demand.

Examples for all data types

The examples in this developer guide primarily use image assets. For sample approaches with other data modalities, please view the developer guide for importing data nested under each asset type in the Import/Export section of the table of contents.

Create a dataset

The only required argument when creating a dataset is the name. You can also specify the IAM integration that you have set up on your account if not specified or set to None it will use your default integration. For more details. including how to get your IAM integrations; visit our dedicated IAM integration page

Get a dataset

Dataset methods

Create data rows

Special character handling

Please note that certain characters like #,<, > and || are not supported in URLs and should be avoided in your file names to prevent loading issues.Please refer to https://datatracker.ietf.org/doc/html/rfc2396#section-2.4.3 on URI standards.A good test for the handling of special characters is to test URLs in your browser address bar — if the URL doesn’t load properly in your browser, it won’t load in Labelbox.
The only required argument when creating a data row is the row_data. However, Labelbox strongly recommends supplying each data row with a global key upon creation.
You can also create data rows with metadata, attachments, and image overlays in the same task. The code below contains an end-to-end example for creating a dataset with data rows that include these elements.

Limits

See this page to learn the limits for creating data rows in one bulk operation. Regardless of your tier’s limit, if you have a large dataset to upload, you can split the data rows into chunks and upload them sequentially.

Task results

The task result is a collection of details, typically information on the data rows associated with the task.

Warning

Large results (over 150,000 data rows) can take up to 10 mins to process.

Task errors

The task errors work similarly to the task results but contain information on any associated errors.

Create a singular data row

Importing a local file

Upload a local file

You can upload a local file to Labelbox storage and use the returned URL to create a data row.

Create data row from a local file

You can also create a data row from a local file directly without uploading it to storage. This creates the file URL and the data row in one step. However, this is not recommended since it increases the time it takes for your data row creation.

Append to an existing dataset

You can add data rows to an existing dataset using the methods described above. First, get a dataset, then create the rows.

Export data rows from a dataset

Filtering the result, you can obtain a list of asset URLs, global keys, or data row IDs.

Export data rows with labels and predictions

For more details, see Export data rows from Catalog.

Update a dataset

Delete a dataset

Deleting a dataset cannot be undoneThis method deletes the dataset along with all data rows in the dataset and any labels made on these data rows. This action cannot be reverted.

Dataset attributes

Get the basics

Get the data rows

The data_rows() attribute is a relationship to the DataRow objects in the dataset. The relationship retrieves a paginated collection of data rows. It is recommended to use exports to get direct data row details especially for larger data sets.

Get the number of data rows

The row_count is a cached attribute; thus, you must re-fetch the dataset after creating data rows to retrieve the updated value.