Skip to main content

Open in Colab

Open in GitHub

This short introduction to Labelbox Python SDK is designed mainly for new users. The example will introduce you to Labelbox Python SDK concepts that you will use commonly. We will demonstrate a simple but common workflow of importing an image data row, setting up a project, and exporting.

Example: Import data rows to exporting from project

Before you start

We must first install the Labelbox library and then import the SDK module. It is recommended to install "labelbox[data]" over labelbox to obtain all the correct dependencies. We will also be importing the Python UUID library to generate universal unique IDs for the variety of objects that will be created with this notebook.
Replace the value of API_KEY with a valid API key to connect to the Labelbox client.

Step 1: Create dataset and import data row

Below, we will create a and then attach a publicly hosted image . Typically, you would import data rows hosted on a cloud provider (recommended) or import them locally. For more information, visit our import image data section in our developer guides. You can find your dataset inside the Catalog section of Labelbox.

Step 2: Creating an ontology

Before sending our data row to a labeling project, we must create an . The example below will create a simple ontology with a bounding box tool and a checklist classification feature. For more information, visit the ontology section inside our developer guides.

Step 3: Creating a project and attaching our ontology

Now that we have made our ontology, we are ready to create a where we can label our data row.

Step 4: Sending our data row to our project by creating a batch

With our project created, we can send our data rows by creating a . Our data rows will start in the initial labeling queue, where labelers are able to annotate our data row. For more information on batches, review the batches section of our developer guides.

Step 5: Exporting from our project

We have now successfully set up a project for labeling using only the SDK! From here, you can either label our data row directly inside the labeling queue or import annotations directly through our SDK. Below we will demonstrate the final step of this guide by exporting from our project. Since we did not label any data rows or import annotations within this guide, no labels will be presented on our data row. For a full overview of exporting, visit our export overview developer guide.

Clean up

This section serves as an optional clean-up step to delete the Labelbox assets created within this guide. You will need to uncomment the delete methods shown.