Datasets - MalondaClement/pipeline GitHub Wiki

Datasets Module

Datasets

Cityscapes πŸŒ†

class datasets.cityscapes.Cityscapes(self, root, split='train', labels_type="label", transform=None, target_transform=None, transforms=None)

[source]

Parameters
  • root (str) - Root directory of dataset where directory leftImg8bit and gtFine or gtCoarse are located.
  • split (str) - The image split to use, train, test or val if mode="fine" otherwise train, train_extra or val.
  • labels_type (str) - (unused)
  • transform - A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.RandomCrop
  • target_transform - A function/transform that takes in the target and transforms it.
  • transforms - A function/transform that takes input sample and its target as entry and returns a transformed version.
Returns
  • Cityscapes
Return type
  • datasets.cityscapes.Cityscapes

Methods

__getitem__(self, index)

MiniCity πŸŒ†

class datasets.minicity.MiniCity(self, root, split='train', labels_type="label", transform=None, target_transform=None, transforms=None)

[source]

Parameters
  • root (str) - Root directory of dataset where directory leftImg8bit and gtFine are located.
  • split (str) - The image split to use, train, test or val if mode=”fine” otherwise train, train_extra or val.
  • labels_type (str) - (unused)
  • transform - A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.RandomCrop
  • target_transform - A function/transform that takes in the target and transforms it.
  • transforms - A function/transform that takes input sample and its target as entry and returns a transformed version.
Returns
  • MiniCity
Return type
  • datasets.minicity.MiniCity

Methods

__getitem__(self, index)

Tunnel 🚘

class datasets.tunnel.Tunnel(self, root, split='train', labels_type="csv", transform=None, target_transform=None, transforms=None)

[source]

Parameters
  • root (str) - Root directory of dataset where directory images and jsons or csvs are located.
  • split (str) - The image split to use, train, test or val (images/train, images/test and images/val).
  • labels_type (str) - Format used labels csv, json or label.
  • transform - A function/transform that takes in a PIL image and returns a transformed version. E.g, transforms.RandomCrop
  • target_transform - A function/transform that takes in the target and transforms it.
  • transforms - A function/transform that takes input sample and its target as entry and returns a transformed version.
Returns
  • Tunnel
Return type
  • datasets.tunnel.Tunnel

Methods

__getitem__(self, index)
Parameters
  • index - Index
Returns
  • (image, target, filepath)
Return type
  • tuple
__len__(self)
Returns
  • Number of element in the split
Return type
  • int
__read_json(self)

Private method used to read json file label when labels_type is json.

__read_csv(self)

Private method used to read json file label when labels_type is csv.

Tunnel directories architecture

-── dataset
    β”œβ”€β”€ images (all images are inside)
    β”‚   β”œ train
    β”‚   β”” test
    β”œβ”€β”€ labels (create in the fonction if it not exists)
    β”œβ”€β”€ jsons (dir with all json file )
    └── csvs (dir with all csv file )