Awesome
utilsCIL
Utility functions for CIL.
In this repository, we provide the following utility classes:
- AverageMeter.py: Computes and stores the average and current value. Imported from pytorch, here
- MyImageFolder.py: Custom ImageFolder class to load images from a list in this format. Example of usage in this file. Then it can be loaded in a dataloader with the following code:
from MyImageFolder import ImagesListFileFolder
train_dataset = ImagesListFileFolder(train_list, transform=transform_train, random_seed=args.random_seed, range_classes=args.range_classes)
train_loader = torch.utils.data.DataLoader(
train_dataset, batch_size=args.batch_size,
shuffle=True, num_workers=args.workers,
pin_memory=True)
- MyFeatureFolder.py: Custom ImageFolder class to load features. Example of usage in this file. Then it can be loaded in a dataloader with the following code:
from MyFeatureFolder import L4FeaturesDataset
train_dataset = L4FeaturesDataset(train_dir, range_classes=args.range_classes)
train_loader = torch.utils.data.DataLoader(
train_dataset, batch_size=args.batch_size,
shuffle=True, num_workers=args.workers,
pin_memory=True)
- Utils.py: Utility functions for CIL.
- modified_resnet.py: Custom ResNet model with different architectures, from Learning a Unified Classifier Incrementally via Rebalancing
- modified_linear.py: Custom linear model with different architectures, from Learning a Unified Classifier Incrementally via Rebalancing