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 directoryleftImg8bit
andgtFine
orgtCoarse
are located. - split (
str
) - The image split to use, train, test or val ifmode="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 directoryleftImg8bit
andgtFine
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 directoryimages
andjsons
orcsvs
are located. - split (
str
) - The image split to use, train, test or val (images/train
,images/test
andimages/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 )