Updated on 2024-04-30 GMT+08:00

Image Segmentation

Training a model uses a large number of labeled images. Therefore, label images before the model training. You can label images on the ModelArts management console. Alternatively, modify labels, or delete them and label them again.

Before labeling an image in image segmentation scenarios, pay attention to the following:

  • All objects whose contours need to be extracted from the image must be labeled.
  • Polygons can be used for labeling.
    • In polygon labeling, draw a polygon based on the outline of the target object.
  • When labeling an image, ensure that the polygons are within the image. Otherwise, an error will occur in subsequent operations.

Data management is being upgraded and is invisible to users who have not used data management.

Starting Labeling

  1. Log in to the ModelArts management console. In the left navigation pane, choose Data Management > Label Data.
  2. On the right of the labeling job list, select a labeling type from the job type drop-down list. Click the job to be performed based on the labeling type. The details page of the job is displayed.
    Figure 1 Selecting a labeling type
  3. The job details page displays all data of the labeling job.

Synchronizing New Data

ModelArts automatically synchronizes data and labeling information from datasets to the labeling job.

To quickly obtain the latest data in a dataset, on the All statuses, Unlabeled, or Labeled tab page of the labeling job details page, click Synchronize New Data.

Symptom:

After the labeled data is uploaded to OBS and synchronized, the data is displayed as unlabeled.

Possible causes:

Automatic encryption is enabled in the OBS bucket.

Solution:

Create an OBS bucket and upload data again, or disable bucket encryption and upload data again.

Filtering Data

On the All statuses, Unlabeled, or tab page, click in the filter criteria area and add filter criteria to quickly filter the data you want to view.

The following filter criteria are available. You can set one or more filter criteria.

  • Example Type: Select Hard example or Non-hard example.
  • Label: Select All or one or more labels you specified.
  • File Name or Path: Filter files by file name or file storage path.
  • Labeled By: Select the name of the user who labeled the image.
  • Sample Attribute: Select the attribute generated by auto grouping. This filter criterion can be used only after auto grouping is enabled.
  • Data Attribute: Select All or Inference to filter the data source.
Figure 2 Filter criteria

Manually Labeling Images

The labeling job details page displays the All statuses, Unlabeled, and Labeled tab pages. The Unlabeled tab page is displayed by default.

  1. On the Unlabeled tab page, click an image. The system automatically directs you to the page for labeling the image. For details about how to use common buttons on this page, see Table 2.
  2. Select a labeling method.
    On the labeling page, common labeling methods and buttons are provided in the toolbar. By default, polygon labeling is selected. Use polygon or pole labeling as needed.

    After you select a method to label the first image, the labeling method automatically applies to subsequent images.

    Table 1 Labeling methods

    Icon

    Description

    Polygon. In the area where the object to be labeled is located, click to label a point, move the mouse and click multiple points along the edge of the object, and then click the first point again. All the points form a polygon. In this way, the object to be labeled is within the bounding box.

    Table 2 Toolbar buttons

    Button

    Features

    Cancel the previous operation.

    Redo the previous operation.

    Zoom in an image.

    Zoom out an image.

    Delete all bounding boxes on the current image.

    Show or hide a bounding box. This operation can be performed only on a labeled image.

    Drag a bounding box to another position or drag the edge of the bounding box to resize it.

    Reset a bounding box. After dragging a bounding box, you can click this button to quickly restore the bounding box to its original shape and position.

    Display the labeled image in full screen.

  3. Label an object.

    Identify an object in an image. Click the top, bottom, leftmost, and rightmost points on the object contour. In the dialog box that is displayed, set the label name and click Add. After labeling an image, click below the image to view in the image list and click an unlabeled image to label the new image.

  4. Click Back to Data Labeling Preview in the upper left part of the page to view the labeling information. In the dialog box that is displayed, click Yes to save the labeling settings.

    The selected images are automatically moved to the Labeled tab page. On the Unlabeled and All statuses tab pages, the labeling information is updated along with the labeling process, including the added label names and the number of images for each label.

Viewing Labeled Images

On the labeling job details page, click the Labeled tab to view the list of labeled images. Click an image to view its labeling information in the File Labels area on the right.

Quick Review

To simplify operations, ModelArts provides quick review so that you can batch review and modify labeled data.

  1. Log in to the ModelArts management console. In the navigation pane, choose Data Management > Label Data. On the My Creations tab page, select the target labeling job type from the All types drop-down list in the upper right corner. (Only object detection and image segmentation support quick review.)
  2. In the labeling job list, click the target labeling job. The labeling details page is displayed.
  3. Click Quick Review on the Labeled tab. On the displayed page, confirm the labeling results.
    Figure 3 Quick Review
  4. Batch review images of the same label.
    1. On the review page, select the label type from the drop-down list next to Filter by Label.
    2. Sort images of the selected label type by bounding box area or aspect ratio.
    3. Click an incorrectly labeled image, and then drag the labeling box to relabel the image. (Modified is displayed on the modified images.)
    4. You can select the incorrectly labeled images, and then click in the upper right corner to delete the label. (Deleted is displayed on the images whose label has been deleted.)
      Figure 4 Modified
      Figure 5 Deleted
    5. You can also modify the label of a labeled image.
      1. Select the target images and click in the All Labels area on the right.
      2. Type a new label and click OK.
        Figure 6 All Labels
        Figure 7 Adding a label
  5. After the modification, click Apply Modifications. In the displayed dialog box, click OK. The system automatically returns to the labeling overview page and overwrites the original labeling data.
    Figure 8 Apply Modifications
  6. If you are not satisfied with the modified data, you can click Cancel Modifications to retain the original labeling data.
    Figure 9 Cancel Modifications
    Table 3 Buttons on the quick review page

    Button

    Features

    Delete the label.

    Undo all operations on the current page.

    Undo the previous operation.

    Redo the previous operation.

Modifying a Label

After labeling data, you can modify labeled data on the Labeled tab page.

On the labeling details page, click the Labeled tab and then the image to be modified. On the labeling page that is displayed, modify the labeling information in the File Labels area on the right.

  • Modifying a label: In the Labeling area, click the edit icon, set the target label name or color in the displayed dialog box, and click to save the modification. Alternatively, click a label to be modified. In the image labeling area, adjust the position and size of the bounding box. After the adjustment is complete, click another label to save the modification.
  • Deleting a label: In the Labeling area, click the deletion icon to delete a label from the image. After all labels of an image are deleted, the image is displayed on the Unlabeled tab page.

After the labeling information is modified, click Back to Data Labeling Preview in the upper left part of the page to exit the labeling page. In the dialog box that is displayed, click Yes to save the modification.

Adding Data

In addition to the data automatically synchronized from datasets, you can directly add images to labeling jobs for labeling. The added data is first imported to the dataset associated with the labeling job. Then, the labeling job automatically synchronizes the latest data from the dataset.

  1. On the labeling job details page, click All statuses, Labeled, or Unlabeled tab, click Add data in the upper left corner.
    Figure 10 Adding Data
  2. Configure the data source, import mode, import path, and labeling status.
    Figure 11 Adding images

  3. Click OK.

    The images you have added will be automatically displayed in the image list on the All statuses tab page. You can choose Add data > View historical records to view task history.

    Figure 12 Viewing historical data

Deleting Images

You can quickly delete the images you want to discard.

On the All statuses, Unlabeled, or Labeled tab page, select the images to be deleted or click Select Images on Current Page, and click Delete in the upper left corner to delete them. In the displayed dialog box, select or deselect Delete the source files from OBS as required. After confirmation, click Yes to delete the images.

If a tick is displayed in the upper left corner of an image, the image is selected. If no image is selected on the page, the Delete button is unavailable.

If you select Delete the source files from OBS, images stored in the OBS directory will be deleted accordingly. This operation may affect other dataset versions or datasets using those files, for example, leading to an error in page display, training, or inference. Deleted data cannot be recovered. Exercise caution when performing this operation.