deepchecks.vision#

Package for vision functionality.

Modules

checks

Module importing all vision checks.

suites

Module contains all prebuilt vision suites.

datasets

Module containing datasets and models for vision tasks.

utils

Package for vision utilities.

Classes

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)#
class ClassificationData[source]#

The ClassificationData class is used to load and preprocess data for a classification task.

It is a subclass of the VisionData class. The ClassificationData class is containing additional data and general methods intended for easily accessing metadata relevant for validating a computer vision classification ML models.

__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)#
class DetectionData[source]#

The DetectionData class is used to load and preprocess data for a object detection task.

It is a subclass of the VisionData class. The DetectionData class is containing additional data and general methods intended for easily accessing metadata relevant for validating a computer vision object detection ML models.

__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)#
class Context[source]#

Contains all the data + properties the user has passed to a check/suite, and validates it seamlessly.

Parameters
trainVisionData , default: None

Dataset or DataFrame object, representing data an estimator was fitted on

testVisionData , default: None

Dataset or DataFrame object, representing data an estimator predicts on

modelBasicModel , default: None

A scikit-learn-compatible fitted estimator instance

model_name: str , default: ‘’

The name of the model

scorersMapping[str, Metric] , default: None

dict of scorers names to a Metric

scorers_per_classMapping[str, Metric] , default: None

dict of scorers for classification without averaging of the classes. See <a href= “https://scikit-learn.org/stable/modules/model_evaluation.html#from-binary-to-multiclass-and-multilabel”> scikit-learn docs</a>

deviceUnion[str, torch.device], default: ‘cpu’

processing unit for use

random_stateint

A seed to set for pseudo-random functions

n_samplesint, default: None
__init__(train: Optional[VisionData] = None, test: Optional[VisionData] = None, model: Optional[Module] = None, model_name: str = '', scorers: Optional[Mapping[str, Metric]] = None, scorers_per_class: Optional[Mapping[str, Metric]] = None, device: Optional[Union[str, device]] = None, random_state: int = 42, n_samples: Optional[int] = None, train_predictions: Optional[Union[List[Tensor], Tensor]] = None, test_predictions: Optional[Union[List[Tensor], Tensor]] = None)[source]#
__new__(*args, **kwargs)#
class SingleDatasetCheck[source]#

Parent class for checks that only use one dataset.

__init__(**kwargs)[source]#
__new__(*args, **kwargs)#
class TrainTestCheck[source]#

Parent class for checks that compare two datasets.

The class checks train dataset and test dataset for model training and test.

__init__(**kwargs)[source]#
__new__(*args, **kwargs)#
class ModelOnlyCheck[source]#

Parent class for checks that only use a model and no datasets.

__init__(**kwargs)[source]#
__new__(*args, **kwargs)#
class Suite[source]#

Tabular suite to run checks of types: TrainTestCheck, SingleDatasetCheck, ModelOnlyCheck.

__init__(name: str, *checks: Union[BaseCheck, BaseSuite])[source]#
__new__(*args, **kwargs)#