> For the complete documentation index, see [llms.txt](https://docs.datasaur.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasaur.ai/advanced/extensions/bounding-box-labels.md).

# Bounding Box Labels

The **Bounding box labels** extension is a core extension for bounding box labeling projects. It contains the label set (taxonomy) used for labeling.

You can add a label set in two ways:

* Upload a label set with a `.csv` , `.tsv` or `.json` format.
* Enter the labels in manually.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-45f4b7d55cb073d8084ba9b5c785dcbe2dd4d5e0%2FPCW%20-%20Step%203%20-%20bounding%20box%20labeling%20-%20initial.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
In the project, you can also click a label instance to jump directly to its corresponding bounding box and open the label box for that item.
{% endhint %}

## Label set modification

If you created a project without a label set, you can add one anytime by:

* Dragging and dropping a label set file.
* Using the three-dot menu.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-29501f573afb433e8b720945c31ed363770be09c%2FExtension%20%20-%20bounding%20box%20labels%20-%20empty%20-%20more%20menu.png?alt=media" alt=""><figcaption></figcaption></figure>

To edit an existing label set, click the three-dot menu and select **Edit label set.**

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-2a07f949c79037b7e4c1ce77c1472c713388316c%2FExtension%20%20-%20bounding%20box%20labels%20-%20filled%20-%20more%20menu.png?alt=media" alt=""><figcaption></figcaption></figure>

The **Edit label set** dialog will open, allowing you to update the label classes and their configuration.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-7f883440f802b48df9571bb583297030ac83c1e2%2FExtension%20%20-%20bounding%20box%20labels%20-%20edit%20label%20set%20-%20standard.png?alt=media" alt=""><figcaption></figcaption></figure>

To replace the current label set, click the three-dot menu and select **Replace existing label set.**

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-2a07f949c79037b7e4c1ce77c1472c713388316c%2FExtension%20%20-%20bounding%20box%20labels%20-%20filled%20-%20more%20menu.png?alt=media" alt=""><figcaption></figcaption></figure>

You can then upload a new label set file or create it from scratch.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-396a9799055b2a55aa633a03ca3c929aeae7d368%2FExtension%20%20-%20bounding%20box%20labels%20-%20replace%20existing%20label%20set%20-%20standard.png?alt=media" alt=""><figcaption></figcaption></figure>

### Permissions

By default, both reviewers and labelers can modify label sets. To restrict this capability for labelers:

1. Go to **File > Settings > Administrator.**
2. Disable the **Label set modification** option.

<figure><img src="https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-88fcdc212a635cdfc355356252ca4e051c2ec8a4%2FProject%20settings%20%20-%20bounding%20box%20labeling%20-%20administrator.png?alt=media" alt=""><figcaption></figcaption></figure>

## Custom attributes for label classes

Each label class can include multiple custom attributes (questions). The question types are limited to [text](https://docs.datasaur.ai/advanced/extensions/pages/sjMjHjQsHtR5BrPf3PUF#id-1.-text-field) and [dropdown](https://docs.datasaur.ai/advanced/extensions/pages/sjMjHjQsHtR5BrPf3PUF#id-3.-dropdown). Each question can have a default answer.

To update custom attributes in a label set:

1. Open the label set editor.

   ![](https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-7f883440f802b48df9571bb583297030ac83c1e2%2FExtension%20%20-%20bounding%20box%20labels%20-%20edit%20label%20set%20-%20standard.png?alt=media)
2. Switch to the **JSON** tab.

   ![](https://448889121-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbjY0HseEqu7LtYAt4d%2Fuploads%2Fgit-blob-d8be839febf1be1b0657ab80be7153f085a22e6f%2FExtension%20%20-%20bounding%20box%20labels%20-%20edit%20label%20set%20-%20json.png?alt=media)
3. Add or modify the <mark style="color:red;">`questions`</mark> field for the desired label class.

{% hint style="info" %}
Modifying the `type` or `internalId` of existing questions is not supported because it can affect previously applied labels unexpectedly.
{% endhint %}

#### Question structure

The <mark style="color:red;">`questions`</mark> field can contain multiple questions with the following properties:

1. **id**: ID of the question.
2. **label**: The question name.
3. **type**: The type of question. It can be <mark style="color:red;">`TEXT`</mark> or <mark style="color:red;">`DROPDOWN`</mark>.
4. **config**: Configuration settings for the question.
   1. **required**: Determines whether the question must be answered. It can be <mark style="color:red;">`true`</mark> or <mark style="color:red;">`false`</mark>.
   2. **defaultValue**: The default answer for the question.
      1. For <mark style="color:red;">`TEXT`</mark> questions, it can be any text.
      2. For <mark style="color:red;">`DROPDOWN`</mark> questions, it must be an <mark style="color:red;">`options.id`</mark> value.
   3. **multiline**: Specifies if the <mark style="color:red;">`TEXT`</mark> question allows multiple lines. It can be <mark style="color:red;">`true`</mark> or <mark style="color:red;">`false`</mark>.
   4. **options**: An array of options for the <mark style="color:red;">`DROPDOWN`</mark> question, each containing:
      1. **id**: ID of the dropdown option. It can be used in the <mark style="color:red;">`defaultValue`</mark>.
      2. **label**: The text label for the dropdown option.
5. **internalId**: Read-only unique ID used internally by Datasaur.

{% hint style="info" %}
For a detailed example, refer to the [Label Sets](/data-studio-projects/lets-get-labeling/bounding-box-labeling.md#label-sets) documentation for a sample bounding box label set with custom attributes.
{% endhint %}
