SEQ CARS196#

Classes#

class datasets.seq_cars196.MyCars196(root, train=True, transform=None, target_transform=None)[source]#

Bases: Dataset

N_CLASSES = 196#

Overrides the CIFAR100 dataset to change the getitem function.

PREPROCESSING_TRANSFORM = Compose(     Resize(size=224, interpolation=bicubic, max_size=None, antialias=True)     CenterCrop(size=(224, 224)) )#
static get_class_names()[source]#
load_and_preprocess_dataset(root, train_str='train')[source]#
class datasets.seq_cars196.SequentialCars196(args)[source]#

Bases: ContinualDataset

Sequential CARS196 Dataset. The images are loaded from deeplake, resized to 224x224, and store locally.

MEAN = (0.0, 0.0, 0.0)#
NAME: str = 'seq-cars196'#
N_CLASSES: int = 196#
N_CLASSES_PER_TASK: int = [20, 20, 20, 20, 20, 20, 20, 20, 20, 16]#
N_TASKS: int = 10#
SETTING: str = 'class-il'#
SIZE: Tuple[int] = (224, 224)#
STD = (1.0, 1.0, 1.0)#
TEST_TRANSFORM = Compose(     ToTensor()     Normalize(mean=(0.0, 0.0, 0.0), std=(1.0, 1.0, 1.0)) )#
TRANSFORM = Compose(     RandomHorizontalFlip(p=0.5)     ToTensor()     Normalize(mean=(0.0, 0.0, 0.0), std=(1.0, 1.0, 1.0)) )#
get_backbone()[source]#
get_batch_size()[source]#
get_class_names()[source]#
get_data_loaders()[source]#
Return type:

Tuple[DataLoader, DataLoader]

static get_denormalization_transform()[source]#
get_epochs()[source]#
static get_loss()[source]#
static get_normalization_transform()[source]#
static get_prompt_templates()[source]#
static get_transform()[source]#

Functions#

datasets.seq_cars196.load_and_preprocess_cars196(train_str='train', names_only=False)[source]#

Loads data from deeplake and preprocesses it to be stored locally.

Parameters:
  • train_str (str) – ‘train’ or ‘test’.

  • names_only (bool) – If True, returns the class names only.

Returns:

If names_only is False, returns a tuple of data, targets, and class_idx_to_name

Return type:

Tuple[torch.Tensor, torch.Tensor, dict] | dict