<a id="easydeeplearning-dataset"></a>

# Managing the Dataset and the Annotations

A dataset is represented by an object of the [`EDataset`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html) type.

A dataset is a collection of images with ground truth annotations. The ground truth annotations depends on the type of tool that you want to use:

* The ground truth annotation for **EasyClassify** and **EasySegment Unsupervised** is a *label*.
* The ground truth annotation for **EasySegment Supervised** is a segmentation map: an image where each pixel has a *segmentation label*.
* The ground truth annotation for **EasyLocate** is a collection of *objects*. An *object* is a point or a bounding box with an *object label*.

#### NOTE
By default, an image has no ground truth annotation of any type.

<a id="easydeeplearning-dataset-capture"></a>

## Capturing Images for Deep Learning tools

* The capture conditions must be as close as possible to the production conditions.
* Preferably, all images should have the same resolution.
* The number of images needed to obtain a good performance depends on the complexity of the task and the tool used.
  * With **EasyClassify**, you can train with as few as 10 images per label. Nevertheless, complex tasks may require more than 100 images per label.
  * With **EasySegment Unsupervised**, you can use less than 10 “good” images. Nevertheless, complex tasks may require more than 100 “good” images.
  * With **EasySegment Supervised**, the required number of images depends on the size and the number of elements to segment in each image. You can use as few as 10 elements per label. Nevertheless, complex tasks may require more than 100 elements per label.
  * With **EasyLocate**, the number of images depends on the number of objects/defects in the images. You can use as few as 10 objects per label. Nevertheless, complex tasks may require more than 100 objects per label.
  * Refer to the [Specifications](../index.html.md#easydeeplearning-specifications) for constraints on the resolution and number of images.

<a id="easydeeplearning-dataset-images"></a>

## Handling Images

<a id="easydeeplearning-dataset-images-add"></a>

### Adding Images

You can add image files or **eVision** image object to a dataset:

* The supported image file types are:
  * PNG
  * TIFF
  * JPEG
  * BMP
  * J2K
* The supported **eVision** image object types are:
  * [`EImageType_BW8`](../../../doxygen_cpp/namespaceeVision.html#ae92dcbfbd112246ab5f719eb21325063) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#ac1a52485aa7956d8f60b4c65b454c7b0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageType.html)
  * [`EImageType_BW16`](../../../doxygen_cpp/namespaceeVision.html#ae92dcbfbd112246ab5f719eb21325063) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#ac1a52485aa7956d8f60b4c65b454c7b0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageType.html)
  * [`EImageType_C24`](../../../doxygen_cpp/namespaceeVision.html#ae92dcbfbd112246ab5f719eb21325063) [<sub>.NET</sub>](../../../doxygen_cs/namespaceeVision.html#ac1a52485aa7956d8f60b4c65b454c7b0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EImageType.html)

The supported image size depends on the type of the deep learning tool:

* **EasyClassify** and **EasyLocate** require that all images have the same size. Images that do not have the size configured for the tool are automatically resized before being processed by the neural network.
* **EasySegment** splits images into patches. As such, the tools can process images of different size and the images are processed at their native resolution.
* In all cases, your dataset should cover the variability of sizes that you want to process in production.

<a id="easydeeplearning-dataset-images-add-dlstudio"></a>

#### Deep Learning Studio

Add image files (`PNG`, `TIFF`, `JPEG`, `BMP` and `J2K` types) to your datasets in one of the following ways:

* Click on the `Add images` button to add images without any label nor segmentation.
  ![](assets/images/easydeeplearning/managing_dataset_1.webp)
* For **EasyClassify** or **EasySegment Unsupervised**
  * right-click on an image label and click `Add images to label` or `Add folder to label` to directly associate these images to the label.
    ![](assets/images/easydeeplearning/managing_dataset_2.webp)
  * Drag and drop your files directly on an image label to directly associate these images to the label.
    ![image](assets/images/easydeeplearning/managing_dataset_3.webp)

#### NOTE
If there is an `.txt` or `.xml` file with the same filename as the image next to it, **Deep Learning Studio** tries to load these files as `YOLO TXT` or `PASCAL VOC XML` annotations.

<a id="easydeeplearning-dataset-images-add-api"></a>

#### API

* Add a single image to a [`EDataset`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html), in the following ways:
  * [`EDataset::AddImage`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a6aff5d57832bc8afd280c25445ba66c8) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a4b9e2020250bda86ce8e411ff953c331) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a90f1abe3ba576cf557614babf86171e5) with the path toward an image file or with an **eVision** image object.
  * You can specify a *classification* label to immediately associate the image with the label. Otherwise, the image is unlabeled.
  * The method returns the index of the image in the dataset. This index is equal to [`EDataset::GetNumImages`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a85515875fd4e8853b6c12be6a5443e85) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#af635f9affd15d765480fa370952743d5) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a7094e1e0f81e114e372a200c7af59a89) `- 1` and can be used to add, remove or modify the annotation for that image afterwards.
* Add several image files with the [`EDataset::AddImages`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#afc7041bee80209f53973a1d7ee1f3e7f) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a704be3c6ff2dff3160c07a459fc340e0) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a00c0883f3b10946b19d5f1481df7accb) method. The method takes a `filter` argument which is a `glob` pattern with the wildcard characters:
  * `*` means “zero or more characters”
  * `?` means “a single character”

  For example, `EDataset::AddImages("*good*.png", "good")` adds all PNG image files that contain “`good`” in their filename.

  This method returns the number of images that were added to the dataset.

<a id="easydeeplearning-dataset-images-roi"></a>

### ROI

With image files, you can use an ROI (region of interest) to crop an image or a whole dataset to a rectangular area aligned with the axis.

#### NOTE
All the ground truth annotations (**EasySegment Supervised** or **EasyLocate**) located outside the region of interest are lost.

* **Deep Learning Studio**
  * To change the ROI:
    1. Select an image from the dataset.
    2. Click on the `ROI` button (`ALT`+`I`).
       ![](assets/images/easydeeplearning/roi_and_mask_1.webp)
    3. Drag the ROI green box, or directly set the ROI origin (`x` and `y`), `Width` and `Height`.
       ![](assets/images/easydeeplearning/roi_and_mask_1b.webp)
  * To set the same ROI for all the images of the dataset:
    1. Set the ROI for one of the image.
    2. Click on the `Apply to All Images` button (`CTRL`+`SHIFT`+`A`).
       ![](assets/images/easydeeplearning/roi_and_mask_3.webp)
  * To visualize the ROI within its parent image, click on the ![](assets/images/easydeeplearning/_icon_view_roi.webp) button.
    ![](assets/images/easydeeplearning/roi_and_mask_2.webp)
* API: use [`EDataset::SetRegionOfInterest`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a0236b63d51838043e59e0300b825fdf0) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a1d27a741140afc1d7f34377d6f153716) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a97ed65cd646cdfe8db8588e75e0aaed4)

<a id="easydeeplearning-dataset-images-mask"></a>

### Mask

Set a mask on an image in a dataset to remove the pixels in the mask area from any computation. The mask works as a “don’t care area”.

* **Deep Learning Studio**
  * To change the mask:
    1. Select an image from the dataset.
    2. Click on the `Mask` button (`ALT`+`M`).
       ![](assets/images/easydeeplearning/roi_and_mask_4.webp)
    3. Select a drawing tool to draw the mask.
       ![](assets/images/easydeeplearning/roi_and_mask_5.webp)
    4. Draw the mask.
       ![](assets/images/easydeeplearning/roi_and_mask_6.webp)

       #### NOTE
       Click on the Open mask button to use an image to specify a mask. All the pixels of the image (such as an `EROIBW8`) that are over 127 are considered as part of the mask.
  * To set the same mask for all the images of the dataset:
    1. Specify the mask for one of the images.
    2. Click on the `Apply to All Images` button (`CTRL`+`SHIFT`+`A`).
       ![](assets/images/easydeeplearning/roi_and_mask_7.webp)
* API
  * Specify the mask when you add the image to the dataset.
  * Or use [`EDataset::SetMask`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ab690d55d713f7410af5fbcd9fce731f5) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ac56b1d03161ae41e81bd1b5ee995b211) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ab549315e2a7066f9a92a7811f31bdde4).

<a id="easydeeplearning-dataset-annotations"></a>

## Annotating the Ground Truth of an Image

Images can have three types of annotation:

* Ground truth image label
* Ground truth segmentation
* Ground truth objects

Each type of annotation has its own label list:

* The  ***image labels*** represent a characteristic of an image and its content. Use them to annotate images for **EasyClassify** or **EasySegment Unsupervised**.
* The  ***segmentation labels*** represent a characteristics of pixels. Use them to annotate image pixels for **EasySegment Supervised**.
* The  ***object labels*** represent a characteristic of a region of an image delimited by a bounding box. Use them to annotate images for **EasyLocate**.

<a id="easydeeplearning-dataset-annotations-states"></a>

### Annotation states

According to whether such an annotation is present, the images can have the following states:

* *Labeled* or *Unlabeled* if the image is or is not associated with an image label.
  * Only labeled images are used to train an **EasyClassify** or an **EasySegment Unsupervised** tool.
  * In the API, use [`EDataset::HasLabel`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a028e0db4fc8cb1240aa5f51db7c92e9c) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a68d7514ecdd271a28cf9244236612caa) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ae647cfa3419a7dafdb843d01593320bf).
* *With or without segmentation* if the image has or has not a ground truth segmentation.
  * Only images with segmentation are used to train an **EasySegment Supervised** tool.
  * In the API, use [`EDataset::HasSegmentation`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a3d2d0b6f6ef5124d48ceb9583be33e81) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a6e3c882300a6bae90dc1c505ae781cf9) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ac64f0ba262cb708b38d1512628f75890).
* *With or without object labeling* if the image has or has not a ground truth objects.
  * Only images with objects are used to train an **EasyLocate** tool.
  * In the API, use [`EDataset::HasObjectLabeling`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a2584bc4990e11e53d9b9f0d7152f997f) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a6fbf2631f97f394e0e3b7817be8768f8) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#afc6e98303edbdb1a94bef879047fd3b4).

We distingish various states for the ground truth annotation of an image:

* The ground truth segmentation of an image has the following state:
  * *Background* when all the pixels of the image are associated with the `Background` segmentation label.
    * In defect detection applications, a background segmentation means that the image contains no defect.
  * *With foreground blobs* when the segmentation contains at least one pixel associated with a segmentation label different from `Background`.
    * In defect detection applications, a segmentation with foreground blobs means that the image contains defects.
    * In the API, use [`EDataset::HasForegroundSegments`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a1c46ec0f6a2ea83636ca600b0f1a8d85) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#afcb3b09f9cd9408014bc58c93bcc28c8) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aecd97f6d8ad7497e0703ccc2c40f2754).
* The ground truth object labeling of an image has the following state:
  * *No objects* when there is no object in the image.
    * In defect detection applications, an image with no object means that the image contains no defect.
  * *With objects* when there is at least one object in the image.
    * In defect detection applications, an image with objects means that the image contains defects.
    * In the API, use [`EDataset::GetImageNumObjects`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ad02a46a832b96f9b3bfdcb11f61800f2) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aae50a6c0a41ff4c4bf25dbdf16e76fa6) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a1527d0271ae6ea85c4f9e0883e8030c2) to determine if the image has objects or not.

In **Deep Learning Studio**, the icons ![](assets/images/easydeeplearning/_icon_visibility_on.webp) (visible) and ![](assets/images/easydeeplearning/_icon_visibility_off.webp) (hidden) represent the visibility state of the images with the corresponding state and/or image label in the image list. Click on these icons to toggle the visibility state.

![](assets/images/easydeeplearning/deeplearningstudio_labels.webp)

<a id="easydeeplearning-dataset-annotations-label"></a>

### Editing the Label of an Image

<a id="easydeeplearning-dataset-annotations-label-dlstudio"></a>

#### Deep Learning Studio

* To change the label of images:
  1. Select one or more images in the image list.
  2. Right click on the selection.
  3. Click on `Set label` and select the new label.
     ![image](assets/images/easydeeplearning/managing_dataset_7a.webp)
* To change the label of a single image:
  1. Click on the image in the list to open the image in the viewer.
  2. In the `Ground truth` tab on the right, select the new label.
     ![image](assets/images/easydeeplearning/managing_dataset_7a.webp)
  3. Or use the keyboard keys `F1` … `F10` to assign the $1^{st}$ … $10^{th}$ label to the image.

<a id="easydeeplearning-dataset-annotations-label-api"></a>

#### API

* Use [`EDataset::SetImageLabel`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a0af61186c660e5518d2ab8e95492ae6b) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a851142735c5c40cbbd01eb84544bf6de) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a5715e2a4d68c808cfdd5e06920aa1427) to change the label of a single image or to a set of image files matching a `glob pattern`.

<a id="easydeeplearning-dataset-annotations-segmentation"></a>

### Editing the Segmentation of an Image

<a id="easydeeplearning-dataset-annotations-segmentation-dlstudio"></a>

#### Deep Learning Studio

* To initialize or reset the segmentation of an image to all `Background` pixels:
  1. Select one or more images in the image list.
     ![image](assets/images/easydeeplearning/managing_dataset_4a.webp)
  2. Right click on the selection.
  3. Click on `Enable/Reset segmentation`.
* To edit the segmentation:
  1. Double click on the image to open it in the image editor.
  2. Click on the `Segmentation` button (`ALT`+`S`).
     ![](assets/images/easydeeplearning/managing_dataset_4b.webp)
  3. To enable or unset the segmentation, check or uncheck the `Segmentation` checkbox (`CTRL`+`S`).
     ![](assets/images/easydeeplearning/managing_dataset_4c.webp)
  4. Select a segmentation label, a drawing tool and enclose the segmentation.
     ![image](assets/images/easydeeplearning/managing_dataset_4d.webp)
  5. Change the segmentation label of a blob by right-clicking on it
     ![image](assets/images/easydeeplearning/managing_dataset_4e.webp)
* The following drawing tools are available:
  * ![](assets/images/easydeeplearning/_icon_rectangle.webp) `Rectangle`: click and drag to create a rectangle.
  * ![](assets/images/easydeeplearning/_icon_ellipse.webp) `Ellipse`: click and drag to create an ellipse.
  * ![](assets/images/easydeeplearning/_icon_polygon.webp) `Polygon`: click to create new vertices and double-click to close the polygon. When the polygon is closed, double click on an edge ton add a new vertex.
  * ![](assets/images/easydeeplearning/_icon_assisted_segmentation.webp) `Assisted segmentation`: click and drag to draw a rectangle around the zone you want to segment. To refine the segmentation, mark the pixels (click and drag) to include in the segmentation.
  * ![](assets/images/easydeeplearning/_icon_lines.webp) `Lines`: click and drag to draw a line with a pen of the specified width.
  * ![](assets/images/easydeeplearning/_icon_free_form.webp) `Free-form drawing`: click and draw any shape with a pen of the specified width.
  * ![](assets/images/easydeeplearning/_icon_eraser.webp) `Eraser`: same as free-form drawing but it assigns a background label instead of the selected segmentation label.
  * ![](assets/images/easydeeplearning/_icon_shrink.webp) `Shrink`: shrinks the blobs of the selected segmentation label.
  * ![](assets/images/easydeeplearning/_icon_grow.webp) `Grow`: grows the blobs of the selected segmentation label.

    Except for the eraser tool, all the tools operate on the label specified in the segmentation tool bar.

<a id="easydeeplearning-dataset-annotations-segmentation-api"></a>

#### API

* Use [`EDataset::UnsetSegmentation`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ac447d0a06264d6014c396c481b0f632b) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a5bc9993a1200c152c03d2c43e4f1808e) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#afae97fc143ed8bc65a3baf9bf200db42) to remove the ground truth segmentation annotation for an image.
* To create or modify the ground truth segmentation of an image:
  * Use [`EDataset::ResetSegmentation`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a62c93fa18012e3302223a3b619aacd2a) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a6585c0a1693260f829027aaf51fe3604) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#adcfbc08c21cf8e06a550970f85772939) to reset the segmentation annotation of an image to its default (full background).
  * Add foreground regions to the segmentation using [`EDataset::AddRegionToSegment`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aad6c5d8dad4b954406e20a7f8586ca2c) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ac2c061ea6769485bcf6c35ce22458a0c) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#abfc52032f76b7344f74377d4fe33538c) where region is an [`ERegion`](../../../doxygen_cpp/classeVision_1_1ERegion.html) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1ERegion.html) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1ERegion.html).
  * Use [`EDataset::SetSegmentationMap`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a75055b76b1eec336c7f466b020ae318c) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aa16dc35551b907c4c14325fc232fe375) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a00551bd5a2cb121617d1136d5436910e) to set the segmentation of the image using a 16 bits image where the value of each pixel corresponds to the segmentation label index of that pixel.

<a id="easydeeplearning-dataset-annotations-objects"></a>

### Editing the Objects of an Image

<a id="easydeeplearning-dataset-annotations-objects-dlstudio"></a>

#### Deep Learning Studio

* To initialize or reset the object labeling of an image:
  1. Select one or more images in the image list.
     ![image](assets/images/easydeeplearning/managing_dataset_5a.webp)
  2. Right click on the selection.
  3. Click on `Reset object labeling`.
* To edit the objects:
  1. Double click on the image to open it in the image editor.
  2. Click on the `Objects` button (`ALT`+`O`).
     ![](assets/images/easydeeplearning/managing_dataset_5b.webp)
  3. To reset or unset the object labeling, uncheck the `Object labeling` checkbox (`CTRL`+`L`).
     ![](assets/images/easydeeplearning/managing_dataset_5c.webp)
  4. Click on the `Add objects` button to add new objects with the label indicated next to the button.
     ![image](assets/images/easydeeplearning/managing_dataset_5d.webp)
  5. Click on the `Edit objects` button to modify the label of an object and the bounding box or the position, according to the **EasyLocate** mode.
     ![](assets/images/easydeeplearning/managing_dataset_5e.webp)![](assets/images/easydeeplearning/managing_dataset_5f.webp)

<a id="easydeeplearning-dataset-annotations-objects-api"></a>

#### API

* Use [`EDataset::UnsetImageObjectLabeling`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a0bc248b7598f16720d503bcda5d8fd58) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ac0464246a74c358ec54acb45fdac71bb) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ad0ae42355b24267d263ae86d4e1aea18) to remove the ground truth object annotation for an image.
* To create or modify the ground truth object annotation of an image:
  * Use [`EDataset::ResetImageObjectLabeling`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a4d42e0c2b7da4ced25741287fd3a0f67) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ab8ec6ee6ff766d0fd16f8203c5df9f6d) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a93d31da04863ca97202eca2227dcc1a8) to reset the object annotation of the image to its default (no object).
  * Use [`EDataset::AddImageObject`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a3a0125784b889e35124fc545d07a58c7) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#af784c237d132861c3a522a2cf0036488) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a222f70630f8d110ef4a696e68dbabc6b) to add an object for an image.
  * Use [`EDataset::SetImageObject`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a2b9c02f7c9405734d8f6afdecd00c038) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a1aaa5c337d09338ae1d54ea364692409) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ace7f1da52dc09eb90c934b50bf20cecb) to change an object for an image.
  * Use [`EDataset::RemoveImageObject`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aea6f542af0ab3feeb238842f1103c3e5) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#af1a762fc4a8f064672d9959f5c1c8fe3) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aa1273c3a7c9602dce35b9256ed471ab4) to remove an object for an image.

<a id="easydeeplearning-dataset-import"></a>

## Importing Standard Dataset

Import dataset or annotations in a standard format:

* `COCO json` dataset for **EasySegment Supervised** and **EasyLocate Axis Aligned Bounding Box** annotations.
  * A `COCO json` dataset is a `json` file contains the annotation for several images.
  * In **Deep Learning Studio**, use the `Import` feature to import a `COCO json` dataset.

  #### NOTE
  See [https://cocodataset.org/#format-data](https://cocodataset.org/#format-data) for a description of the `COCO json` dataset format.
* The `YOLO TXT` annotation format for **EasyLocate Axis Aligned Bounding Box** annotations.
  * For each image, the annotations are in a file with the same filename as the image and the `.txt` extension.
  * The label of each bounding box is encoded through its ID. A label file mapping the label id to the actual label must be provided to import the annotations.
  * In **Deep Learning Studio**, if the annotation files are located in the same folder as their corresponding images, use the `Add images` feature to import the images and their annotations.
  * With the API, use [`EDataset::ImportYOLOTXTAnnotations(imgId, labelFile)`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a5bb551c7ac976d7d6479a5f18e154ada) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a7831dea48b23034bb6838bfc9ec6a3d5) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a148b7c4d412a70d9939039a8f68a17bf) to import the annotation for an image.

  #### NOTE
  See [https://pjreddie.com/darknet/yolo](https://pjreddie.com/darknet/yolo) for he original YOLO source code.
* `PASCAL VOC XML` annotation for EasyLocate Axis Aligned Bounding Box annotations.
  * For each image, the annotations are in a file with the same filename as the image and the `.xml` extension.
  * In **Deep Learning Studio**, if the annotation files are located in the same folder as their corresponding images, use the Add images feature to import the images and their annotations.
  * With the API, use [`EDataset::ImportPascalVOCXMLAnnotations(imgId)`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aaf48b040f74ddd587c75857a2e28b743) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aebca2aba14151fc4dcfc83b0f1632176) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a5c92f1a180f60a8ba78c984982fed36e) to import the annotation for an image.

  #### NOTE
  See [http://host.robots.ox.ac.uk/pascal/VOC](http://host.robots.ox.ac.uk/pascal/VOC) for resources on the `PASCAL VOC XML` annotations.
* Check the available annotations for a file with [`EDataset::GetAvailableImageAnnotationFormat(filePath)`](../../../doxygen_cpp/classeVision_1_1EasyDeepLearning_1_1EDataset.html#a4fcbb806478d5b448b8922d3d4f0350a) [<sub>.NET</sub>](../../../doxygen_cs/classeVision_1_1EasyDeepLearning_1_1EDataset.html#aa5297cae9656860c3d29b8206ec74b72) [<sub>Python</sub>](../../../doxygen_python/classeVision_1_1EasyDeepLearning_1_1EDataset.html#ac17f9ac74ae9023373857a1de88edfb9).
