Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#717 Feature/sg 636 pose estimation metrics

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:feature/SG-636-pose-estimation-metrics

Computer Vision Datasets Setup

SuperGradients provides multiple Datasets implementations.

Classification Datasets

Cifar10

Supports download

from super_gradients.training.datasets import Cifar10
dataset = Cifar10(..., download=True)
Imagenet
  1. Download imagenet dataset:

  2. Unzip:

    Imagenet
     ├──train
     │  ├──n02093991
     │  │   ├──n02093991_1001.JPEG
     │  │   ├──n02093991_1004.JPEG
     │  │   └──...
     │  ├──n02093992
     │  └──...
     └──val
        ├──n02093991
        ├──n02093992
        └──...
  1. Instantiate the dataset:
from super_gradients.training.datasets import ImageNetDataset
train_set = ImageNetDataset(root='.../Imagenet/train', ...)
valid_set = ImageNetDataset(root='.../Imagenet/val', ...)

Detection Datasets

Coco
  1. Download coco dataset:

  2. Unzip and organize it as below:

    coco
    ├── annotations
    │      ├─ instances_train2017.json
    │      ├─ instances_val2017.json
    │      └─ ...
    └── images
        ├── train2017
        │   ├─ 000000000001.jpg
        │   └─ ...
        └── val2017
            └─ ...
  1. Instantiate the dataset:
from super_gradients.training.datasets import COCODetectionDataset
train_set = COCODetectionDataset(data_dir='.../coco', subdir='images/train2017', json_file='instances_train2017.json', ...)
valid_set = COCODetectionDataset(data_dir='.../coco', subdir='images/val2017', json_file='instances_val2017.json', ...)
PascalVOC 2007 & 2012

Supports download

from super_gradients.training.datasets import PascalVOCDetectionDataset
train_set = PascalVOCDetectionDataset(download=True, ...)

Dataset Structure:

    Dataset structure:
        ├─images
        │   ├─ train2012
        │   ├─ val2012
        │   ├─ VOCdevkit
        │   │    ├─ VOC2007
        │   │    │  ├──JPEGImages
        │   │    │  ├──SegmentationClass
        │   │    │  ├──ImageSets
        │   │    │  ├──ImageSets/Segmentation
        │   │    │  ├──ImageSets/Main
        │   │    │  ├──ImageSets/Layout
        │   │    │  ├──Annotations
        │   │    │  └──SegmentationObject
        │   │    └──VOC2012
        │   │       ├──JPEGImages
        │   │       ├──SegmentationClass
        │   │       ├──ImageSets
        │   │       ├──ImageSets/Segmentation
        │   │       ├──ImageSets/Main
        │   │       ├──ImageSets/Action
        │   │       ├──ImageSets/Layout
        │   │       ├──Annotations
        │   │       └──SegmentationObject
        │   ├─train2007
        │   ├─test2007
        │   └─val2007
        └─labels
            ├─train2012
            ├─val2012
            ├─train2007
            ├─test2007
            └─val2007

Segmentation Datasets

Cityscapes
  1. Download dataset:

  2. a. Unzip and organize cityscapes dataset as below:

  root_dir (in recipe default to /data/cityscapes)
      ├─── gtFine
      │       ├── test
      │       │     ├── berlin
      │       │     │   ├── berlin_000000_000019_gtFine_color.png
      │       │     │   ├── berlin_000000_000019_gtFine_instanceIds.png
      │       │     │   └── ...
      │       │     ├── bielefeld
      │       │     │   └── ...
      │       │     └── ...
      │       ├─── train
      │       │     └── ...
      │       └─── val
      │             └── ...
      └─── leftImg8bit
              ├── test
              │     └── ...
              ├─── train
              │     └── ...
              └─── val
                    └── ...
  1. b. Unzip and organize metadata folder as below:
  lists
      ├── labels.csv
      ├── test.lst
      ├── train.lst
      ├── trainval.lst
      └── val.lst
  1. c. Move Metadata folder to the Cityscapes folder
  root_dir (in recipe default to /data/cityscapes)
      ├─── gtFine
      │      └── ...
      ├─── leftImg8bit
      │      └── ...
      └─── lists
             └── ...
  1. Instantiate the dataset:
from super_gradients.training.datasets import CityscapesDataset

train_set = CityscapesDataset(root_dir='.../root_dir', list_file='lists/train.lst', labels_csv_path='lists/labels.csv', ...)
Coco
  1. Download coco dataset:

  2. Unzip and organize it as below:

    coco
    ├── annotations
    │      ├─ instances_train2017.json
    │      ├─ instances_val2017.json
    │      └─ ...
    └── images
        ├── train2017
        │   ├─ 000000000001.jpg
        │   └─ ...
        └── val2017
            └─ ...
  1. Instantiate the dataset:
from super_gradients.training.datasets import CoCoSegmentationDataSet
train_set = CoCoSegmentationDataSet(data_dir='.../coco', subdir='images/train2017', json_file='instances_train2017.json', ...)
valid_set = CoCoSegmentationDataSet(data_dir='.../coco', subdir='images/val2017', json_file='instances_val2017.json', ...)
Pascal VOC 2012
  1. Download pascal datasets:

  2. Unzip and organize it as below:

   pascal_voc_2012
       └──VOCdevkit
             └──VOC2012
                ├──JPEGImages
                ├──SegmentationClass
                ├──ImageSets
                │    ├──Segmentation
                │    │   └── train.txt
                │    ├──Main
                │    ├──Action
                │    └──Layout
                ├──Annotations
                └──SegmentationObject
  1. Instantiate the dataset:
from super_gradients.training.datasets import PascalVOC2012SegmentationDataSet

train_set = PascalVOC2012SegmentationDataSet(
     root='.../pascal_voc_2012',
     list_file='VOCdevkit/VOC2012/ImageSets/Segmentation/train.txt',
     samples_sub_directory='VOCdevkit/VOC2012/JPEGImages',
     targets_sub_directory='VOCdevkit/VOC2012/SegmentationClass',
     ...
 )
valid_set = PascalVOC2012SegmentationDataSet(
     root='.../pascal_voc_2012',
     list_file='VOCdevkit/VOC2012/ImageSets/Segmentation/val.txt',
     samples_sub_directory='VOCdevkit/VOC2012/JPEGImages',
     targets_sub_directory='VOCdevkit/VOC2012/SegmentationClass',
     ...
 )
Pascal AUG 2012
  1. Download pascal datasets:

  2. Unzip and organize it as below:

   pascal_voc_2012
       └──VOCaug
           ├── aug.txt
           └── dataset
                 ├──inst
                 ├──img
                 └──cls
  1. Instantiate the dataset:
from super_gradients.training.datasets import PascalAUG2012SegmentationDataSet

train_set = PascalAUG2012SegmentationDataSet(
     root='.../pascal_voc_2012',
     list_file='VOCaug/dataset/aug.txt',
     samples_sub_directory='VOCaug/dataset/img',
     targets_sub_directory='VOCaug/dataset/cls',
     ...
 )

NOTE: this dataset is only available for training. To test, please use PascalVOC2012SegmentationDataSet.

Pascal AUG & VOC 2012
  1. Download pascal datasets:

  2. Unzip and organize it as below:

   pascal_voc_2012
       ├─VOCdevkit
       │ └──VOC2012
       │    ├──JPEGImages
       │    ├──SegmentationClass
       │    ├──ImageSets
       │    │    ├──Segmentation
       │    │    │   └── train.txt
       │    │    ├──Main
       │    │    ├──Action
       │    │    └──Layout
       │    ├──Annotations
       │    └──SegmentationObject
       └──VOCaug
           ├── aug.txt
           └── dataset
                 ├──inst
                 ├──img
                 └──cls
  1. Instantiate the dataset:
from super_gradients.training.datasets import PascalVOCAndAUGUnifiedDataset
train_set = PascalVOCAndAUGUnifiedDataset(root='.../pascal_voc_2012', ...)

NOTE: this dataset is only available for training. To test, please use PascalVOC2012SegmentationDataSet.

Supervisely Persons
  1. Download supervisely dataset:

  2. Unzip:

   supervisely-persons
    ├──images
    │    ├──image-name.png
    │    └──...
    ├──images_600x800
    │    ├──image-name.png
    │    └──...
    ├──masks
    └──masks_600x800
  1. Instantiate the dataset:
from super_gradients.training.datasets import SuperviselyPersonsDataset
train_set = SuperviselyPersonsDataset(root_dir='.../supervisely-persons', list_file='train.csv', ...)
valid_set = SuperviselyPersonsDataset(root_dir='.../supervisely-persons', list_file='val.csv', ...)

NOTE: this dataset is only available for training. To test, please use PascalVOC2012SegmentationDataSet.

Pose Estimation Datasets

COCO 2017
  1. Download coco dataset:

  2. Unzip and organize it as below:

    coco
    ├── annotations
    │      ├─ person_keypoints_train2017.json
    │      ├─ person_keypoints_val2017.json
    │      └─ ...
    └── images
        ├── train2017
        │   ├─ 000000000001.jpg
        │   └─ ...
        └── val2017
            └─ ...
  1. Instantiate the dataset:
from super_gradients.training.datasets import COCOKeypointsDataset
train_set = COCOKeypointsDataset(data_dir='.../coco', images_dir='images/train2017', json_file='annotations/instances_train2017.json', ...)
valid_set = COCOKeypointsDataset(data_dir='.../coco', images_dir='images/val2017', json_file='annotations/instances_val2017.json', ...)
Discard
Tip!

Press p or to see the previous file or, n or to see the next file