megengine.data¶
>>> import megengine.data as data
>>> import megengine.data.transform as T
DataLoader¶
Data loader. |
Dataset¶
An abstract base class for all map-style datasets. |
|
ArrayDataset is a dataset for numpy array data. |
|
All datasets that represent an iterable of data samples should subclass it. |
|
ConcatDataset is a concatenation of multiple datasets. |
Vision Dataset¶
ImageFolder is a class for loading image data and labels from a organized folder. |
|
MNIST dataset. |
|
|
|
|
|
Pascal VOC Dataset. |
|
MS COCO Dataset. |
|
Cityscapes Dataset. |
|
Objects365 Dataset. |
|
Load ImageNet from raw files or folder. |
Sampler¶
An abstract base class for all Sampler |
|
Sampler for map dataset. |
|
Sampler for stream dataset. |
|
Sample elements sequentially. |
|
Sample elements randomly without replacement. |
|
Sample elements randomly with replacement. |
|
Infinite Sampler warper for basic sampler. |
Transform¶
Rewrite apply method in subclass. |
|
Vision Transform¶
Base class of all transforms used in computer vision. |
|
Composes several transfomations together. |
|
Compose class used for transforms in torchvision, only support PIL image, some transforms with tensor in torchvision are not supported, such as Normalize and ToTensor in torchvision. |
|
Change input data to a target mode. |
|
Pad the input data. |
|
Resize the input data. |
|
Resize the input data with specified shortset edge. |
|
Resize the input data randomly. |
|
Crop the input data randomly. |
|
Crop the input data to random size and aspect ratio. |
|
Crops the given the input data at the center. |
|
Horizontally flip the input data randomly with a given probability. |
|
Vertically flip the input data randomly with a given probability. |
|
Normalize the input data with mean and standard deviation. |
|
Add random gaussian noise to the input data. |
|
Adjust brightness of the input data. |
|
Adjust saturation of the input data. |
|
Adjust contrast of the input data. |
|
Adjust hue of the input data. |
|
Randomly change the brightness, contrast, saturation and hue of an image. |
|
Apply AlexNet-Style "lighting" augmentation to input data. |
Collator¶
Used for merging a list of samples to form a mini-batch of Tensor(s). |