Labelbox documentation

Getting started

  1. Make sure you have the proper authentication.

  2. Create a project.

  3. Create your dataset and import data.

  4. Use this sample script to get the IDs for your data rows.

    from labelbox import Client
    
    client = Client(api_key="<LABELBOX_API_KEY>")
    project = client.get_project("<PROJECT_ID>")
    
    dataset = client.get_dataset("<DATASET_ID>")
    
    for data_row in dataset.data_rows():
         data_row.uid
  5. Get the project ontology. When you create your import file, you will need to reference the schemaId for each annotation type in your project's ontology. To get the value for each schemaId, use this sample script. Keep this ontology handy as you will need to reference the featureSchemaId values from this query in your import file.

    def get_ontology(client: Client, project_id: str) -> Dict[str, str]:
        result = client.execute("""
             query get_ontology($proj_id: ID!) {
                project(where: {id: $proj_id}) {
                     ontology {
                         normalized
                     }
                 }
             }
         """, {"proj_id": project_id})
    return result['project']['ontology']['normalized']
  6. Turn on Model-assisted labeling for your project by navigating to Settings > Automation. When this is on, you will be able to view the imported annotations on an asset when you open it in the Editor. Only admins can toggle on/off Model-assisted labeling. You can also turn on Model-assisted labeling for a project programmatically via the Python SDK.

    from labelbox import Client
    
    client = Client("<Labelbox_API_Key>")
    project = client.get_project("<Project_ID>")
    
    project.enable_model_assisted_labeling(True)

When an asset is loaded in the Editor, any predictions for that asset will show up as editable annotations for the user. Imported annotations will appear when the asset is opened in the Editor as long as the following conditions are met:

  • Model-assisted labeling is on

  • The imported annotations are assigned to a Data Row

  • The asset has not already been labeled in the Labelbox Editor

Currently, if a labeler skips or submits a label without making any changes first, the timer will not start and the duration time recorded will be 0 seconds. This logic may be revised in a future update.