Table of Contents

Creating your first project

Alex Cota Updated by Alex Cota

This page breaks down, step by step, how to create a basic project. To see our sample Python script for a complete project setup, see Project setup script.

Before you start

Complete the installation and authentication steps before continuing. To better understand the concepts below, take a moment to read Data types overview.

Make sure the API client is initialized:

from labelbox import Client
client = Client()

Basic project setup

Step 1 Build your project's foundation

In the rough hierarchical structure of Labelbox’s data objects, Projects and Datasets are considered "top-level" objects. They are the foundation upon which your labeling pipeline is structured. Because they are top-level, Projects and Datasets are created using the Labelbox Client directly.

Use the create_project method to create and name your Project. You will be attaching your Datasets to your Project so name it accordingly.

project = client.create_project(name="<project_name>")

Within your project, use the create_dataset method to create a Dataset, name it, and attach it to your Project.

dataset = client.create_dataset(name="<dataset_name>", projects=project)
Step 2 Add data to your project

There are two ways to create data rows within a dataset, in bulk and individually. For details on acceptable file types, see Data import overview.

The create_data_row method accepts files individually and is a synchronous operation.

dataset = client.get_dataset("<dataset_id>")
data_row = dataset.create_data_row(row_data="http://my_site.com/photos/img_01.jpg")

You can also pass a string to a local file.

data_row = dataset.create_data_row(row_data="path/to/file.jpg")

For instructions on how to bulk upload data rows using the create_data_rows method, see Data Rows.

Step 3 Select label editor and ontology

You have several options for selecting a labeling frontend and an ontology for your project. For some examples, see our Project setup script, a complete code sample that includes the steps above and more.

Next Steps

Now that you have set up your first project, explore Projects, Datasets, Data Rows, and Labels pages to learn how to do more with the Python SDK.

Was this page helpful?

Getting started

Project setup script

Contact