---
title: "Label spec with images"
slug: "create-label-spec-with-image-based-class"
updated: 2025-08-18T12:13:17Z
published: 2025-08-18T12:13:17Z
canonical: "docs.akridata.ai/create-label-spec-with-image-based-class"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.akridata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Label spec with images

Label specs support image samples to be provided for classes that cannot be described well with text. You can create classes for the label spec by uploading images locally or importing images from different sources. This article explains how to create a label spec using sample images for classes.

## Create label spec using sample images

1. On the left navigation pane, navigate to **Labeling** > **Specs**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/label-spec-menu.jpg)
2. Click the **Add Spec** button on the top-right corner. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/add-spec.jpg)
3. In the **Spec Type** window, select **Classification** or **Detection**, and click **Submit**.
4. In the New Spec screen, enter **Spec Description**. Spec Type is pre-filled based on your selection in the previous step.
5. Under the class section, click **Add Class** to add a class. You can add a class using text parameters, images, or both.
6. Enter a **Class Name**.
7. Click the **+** (plus) icon on the right side of **Image Samples** section. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/spec-name-description.jpg)
8. Select one of the following ways to add the sample images: ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-image-options.jpg)
  1. **Image repository**
    1. Click to browse and **Upload** images from your local system to the repository
    2. Select the images required as sample images for the class, and click **OK**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/image-repository.jpg)
  2. **Query catalog**
    1. Click to import images from the catalog based on the selected **Dataset** and **Table/View**.
    2. Select the required sample images and click **Add**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/query-catalog-images.jpg)
  3. **Public URL**: You can upload images directly from the image website URL with public access.
  4. **From Text Search**: Use this option to search for images using text.
    1. Select the **DataSet** and **Job**.
    2. Enter the text (for example, cat) that you want to be used for searching images, and click **Search**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/query-using-text.jpg)
    3. Select the images that you want to add as samples and click **Add**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/query-using-text-add.jpg)
  5. **From Resultset**: You can query for images by selecting a result set created earlier. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/query-result-set.jpg)
9. Once you add the images, you can review and update the images on the Sample Images screen, as needed, and click **OK**.
  1. Enable the **Bounding Box** option on the top-right corner to draw an area on this image that should be considered for labeling.
  2. Click **Clear** at the bottom-right corner to clear the bounding box from the image.
  3. Click **Remove** at the bottom-right corner to delete the sample image.

![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/image-sample-bounding-box.jpg)

The images samples are added to the class. You can click the **+** (plus) icon to add more images, or click the pen or eye icons to review and update the images. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-function-icons.jpg)
10. Specify the text versus image weightage using the ‘Text weight’ slider. For a class, you can do one of the following:
  1. Set the **Text Weight** slider to specify the weightage of text prompts to be considered.
  2. Ignore the text prompt and select the **Use Images Only** check box to consider only the image samples.
  3. Uncheck the **Use Images Only** check box, and set the **Text Weight** slider to specify the weightage for that specific class to override the spec level **Text Weight** setting. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-text-weight.jpg)
11. Click the **Analyze** button to autogenerate the prompts.
12. Select a **Prompt** that best matches the details and click **Analyze** again to autogenerate the extra prompts. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-analyze.jpg) The extra prompts are pre-selected by default.
13. Click and unselect the prompts as needed.
14. Click the **thumbs-up** icon against the suggested **Description** and **Superclass**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-extra-prompt-list.jpg)
15. Click **Approve**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/approve-button(2).jpg) The class will appear under the **Approved** tab, which displays the count of approved classes. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-approved-count.jpg)
16. Add more than one class for labeling, if needed.
  1. Click **Add Class** or the **+** (plus) sign, as shown. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/new-spec-add-class.jpg)
  2. Repeat the steps to add more than one class to the page based on your image data.
17. Click the **Approve** button. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/approve-button(1).jpg)
18. Click **Save**, enter a **Spec Name** and click the **Save** button. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/save-spec-by-image.jpg)

The label spec will now be listed under the Labeling Spec page.

## Create label spec using Global Image Samples

The previous section discussed adding image samples on a per-class basis. An alternate way to add sample images is to select and use the annotations(class names or bounding boxes) for all classes from these images.

1. On the left navigation pane, navigate to **Labeling** > **Specs**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/label-spec-menu(1).jpg)
2. Click the **Add Spec** button on the top-right corner. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/global-images-add-spec.jpg)
3. In the **Spec Type** window, select **Classification** or **Detection**, and click **Submit**.
4. In the spec screen, enter **Spec Description**. Spec Type is prefilled based on your selection in the previous step.
5. Click the **Global Image Samples** button. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/global-image-add-class.jpg)
6. In the **Add Global Image Prompts** window, select the **Dataset** and **View**for which the label is set to **boundingbox2dgt** or **boundingbox2dpred**. For a classification job, the column types supported are **classlabelgt** and **classlabelpred**. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/global image-label-field.jpg)
7. Add the conditions to search for the images and click **Submit Query**if needed. The images are populated on the **Add Global Image Prompts** window.
8. Click the filter icon on the top-right corner to add more conditions and tune the search.
9. Click the **Add**button at the top-right corner. ![](https://cdn.document360.io/3e9d4528-fbc6-4948-a804-8ee7068e7ac3/Images/Documentation/global-image-add-button.jpg)

If a class corresponds to any of the global images, those images will automatically get added as sample images for the class.

> [!NOTE]
> The display name is used to match the class name.
10. Click **Approve** and then **Save**.
