VisionData#
- class VisionData[source]#
VisionData represent a base task in deepchecks. It wraps PyTorch DataLoader together with model related metadata.
The VisionData class is containing additional data and general methods intended for easily accessing metadata relevant for validating a computer vision ML models.
- Parameters
- data_loaderDataLoader
PyTorch DataLoader object. If your data loader is using IterableDataset please see note below.
- num_classesint, optional
Number of classes in the dataset. If not provided, will be inferred from the dataset.
- label_mapDict[int, str], optional
A dictionary mapping class ids to their names.
- transform_fieldstr, default: ‘transforms’
Name of transforms field in the dataset which holds transformations of both data and label.
- __init__(data_loader: DataLoader, num_classes: Optional[int] = None, label_map: Optional[Dict[int, str]] = None, transform_field: Optional[str] = 'transforms')[source]#
- __new__(*args, **kwargs)#
Attributes
Return dict of classes as keys, and list of corresponding indices (in Dataset) of samples that include this class (in the label). |
|
Return how many dimensions the image data have. |
|
Return the data loader. |
|
Return True if the data loader has images. |
|
Return True if the data loader has labels. |
|
Return a dictionary containing the number of samples per class. |
|
Return the number of classes in the dataset. |
|
Return the number of samples in the dataset. |
|
Return the number of samples in the original dataset. |
|
Return the task type: classification, object_detection or other. |
|
Return the data loader. |
Methods
Assert the image formatter defined is valid. |
|
Assert the label formatter defined is valid. |
|
|
Return batch samples of the given batch indices. |
|
Transform a batch of data to images in the accpeted format. |
|
Transform a batch of data to labels. |
|
Create new copy of this object, with the data-loader and dataset also copied, and altered by the given parameters. |
|
Create VisionData instance from a Dataset instance. |
Return a copy of the vision data object with the augmentation in the start of it. |
|
|
Get a labels batch and return classes inside it. |
Return transforms handler created from the transform field. |
|
|
Infer on a batch of data. |
Initialize the cache of the classes' metadata info. |
|
Return whether the vision data is running on sample of the data. |
|
|
Return the name of the class with the given id. |
|
Use the defined collate_fn to transform a few data items to batch format. |
|
Return for the given batch_index the sample index in the dataset object. |
|
Get labels and update the classes' metadata info. |
|
Validate the correctness of the data class implementation according to the expected format. |
Validate that the get_classes function returns data in the correct format. |
|
Validate that the data is in the required format. |
|
Validate the infered predictions from the batch. |
|
|
Validate a batch of labels. |
|
Validate the prediction. |
Verify presence of shared labels. |