Selecting Data

Select data and create a training dataset for subsequent model training.

Prerequisites

Requirements on Datasets

  • Unlabeled datasets

    Images must be stored in one directory, as shown in the following example.

    ├─dataset-import-example 
    │      IMG_20180919_114732.jpg 
    │      IMG_20180919_114745.jpg 
    │      IMG_20180919_114945.jpg 
    • If data is imported from an OBS path, you must have the permission to read the OBS path.
    • Images in JPG, JPEG, PNG, and BMP formats are supported.
  • Labeled datasets

    Labeled objects and their labeling files (in one-to-one relationship with the labeled objects) must be in the same directory. For example, if the name of the labeled object file is IMG_20180919_114745.jpg, the name of the labeling file must be IMG_20180919_114745.xml.

    The labeling files must be in PASCAL VOC format. For details about the format, see Table 1.

    Example:

    ├─dataset-import-example 
    │      IMG_20180919_114732.jpg 
    │      IMG_20180919_114732.xml 
    │      IMG_20180919_114745.jpg 
    │      IMG_20180919_114745.xml 
    │      IMG_20180919_114945.jpg 
    │      IMG_20180919_114945.xml

    A labeling file example is as follows:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <annotation>
        <folder>NA</folder>
        <filename>bike_1_1593531469339.png</filename>
        <source>
            <database>Unknown</database>
        </source>
        <size>
            <width>554</width>
            <height>606</height>
            <depth>3</depth>
        </size>
        <segmented>0</segmented>
        <object>
            <name>Dog</name>
            <pose>Unspecified</pose>
            <truncated>0</truncated>
            <difficult>0</difficult>
            <occluded>0</occluded>
            <bndbox>
                <xmin>279</xmin>
                <ymin>52</ymin>
                <xmax>474</xmax>
                <ymax>278</ymax>
            </bndbox>
        </object>
        <object>
            <name>Cat</name>
            <pose>Unspecified</pose>
            <truncated>0</truncated>
            <difficult>0</difficult>
            <occluded>0</occluded>
            <bndbox>
                <xmin>279</xmin>
                <ymin>198</ymin>
                <xmax>456</xmax>
                <ymax>421</ymax>
            </bndbox>
        </object>
    </annotation>
    
    • Images in JPG, JPEG, PNG, and BMP formats are supported. The size of a single image cannot exceed 5 MB, and the total size of all images uploaded in one attempt cannot exceed 8 MB.
      Table 1 PASCAL VOC format description

      Parameter

      Mandatory

      Description

      folder

      Yes

      Directory where the data source is located

      filename

      Yes

      Name of the file to be labeled

      size

      Yes

      Image pixel

      • width: image width. This parameter is mandatory.
      • height: image height. This parameter is mandatory.
      • depth: number of image channels. This parameter is mandatory.

      segmented

      Yes

      Segmented or not

      object

      Yes

      Object detection information. Multiple object{} functions are generated for multiple objects.

      • name: class of the labeled object. This parameter is mandatory.
      • pose: shooting angle of the labeled object. This parameter is mandatory.
      • truncated: whether the labeled object is truncated (0 indicates that the object is not truncated). This parameter is mandatory.
      • occluded: whether the labeled object is occluded (0 indicates that the object is not occluded). This parameter is mandatory.
      • difficult: whether the labeled object is difficult to identify (0 indicates that the object is easy to identify). This parameter is mandatory.
      • confidence: confidence score of the labeled object. The value range is 0 to 1. This parameter is optional.
      • bndbox: type of the bounding box. This parameter is mandatory. When labeling with the surface defect recognition workflow on steel sheets, you are advised to set the bounding box type to bndbox, namely, select the rectangle as the bounding box type to label the defects. The labeling information indicates coordinates of upper left and lower right points, as shown in the following:
        <xmin>100<xmin>
        <ymin>100<ymin>
        <xmax>200<xmax>
        <ymax>200<ymax>

Accessing the Application Development Page

  • Method 1: Accessing the page for the first time

    Create an application as described in Creating an Application based on a preset workflow. The Application Development page is directly displayed.

  • Method 2: Accessing the page when you have created an application before

    Log in to the ModelArts Pro > Vision Suite console. By default, the AppDev > Workbench page is displayed. Locate the target application and click View in the Operation column. The Application Development page is displayed.

Creating Training Datasets

Choose Application Development > Select Data. On the page that is displayed, click Create Dataset. On the Create Dataset page that is displayed on the right, set basic information about a dataset based on its storage location and labeling information and click OK. For details, see Table 2.

Table 2 Parameters required for creating a dataset

Parameter

Description

Dataset

Name of a dataset to be created

Description

Dataset description

Upload Mode

Mode for uploading training data. Currently, data can only be uploaded to OBS. Therefore the default value is OBS.

Input Dataset Path

Location where training data is stored in OBS

Click the text box on the right of Input Dataset Path. In the displayed dialog box, select an OBS bucket and folder, and click OK.

Output Dataset Path

Location where the dataset to be created is stored in OBS

There is a default path for storing a dataset to be created. To modify it, click Modify on the right of Output Dataset Path. In the displayed dialog box, select an OBS bucket and folder, and click OK.

After creating training datasets, select the training dataset required for application development.

Labeled data is required during model training. For uploaded datasets, you can add or modify labels.

Click Label in the Operation column of the dataset. On the Dashboard page that is displayed, click Label in the upper right corner. On the displayed page, manually label data. For details, see Labeling Data > Object Detection.

When labeling data with the hot-rolled steel sheet surface defect recognition workflow, set the bounding box type to bndbox, namely, select the rectangle as the bounding box type to label the defects.

Viewing Label Parsing

After creating and selecting a training dataset, you can view the statistical data of label samples in the Label Parsing area. The horizontal axis indicates the labels, and the vertical axis indicates the number of valid samples corresponding to the label.

Follow-up Operations

After selecting the training dataset, click Next to go to step Train Model. For details, see Training a Model.