detectors.models packageο
Submodulesο
detectors.models.densenet moduleο
Densenet models for CIFAR10, CIFAR100 and SVHN datasets.
detectors.models.resnet moduleο
ResNet models for CIFAR10, CIFAR100, and SVHN datasets.
detectors.models.utils moduleο
- class detectors.models.utils.ModelDefaultConfig(url: str, num_classes: int, input_size: Tuple[int, int, int] | Tuple[int, int] | int, pool_size: Tuple[int, int] | None, crop_pct: float, mean: Tuple[float, float, float], std: Tuple[float, float, float], first_conv: str, classifier: str, architecture: str, interpolation: str = 'bilinear', fixed_input_size: bool | None = False, **kwargs)[source]ο
Bases:
dictDefault configuration for models from timm library.
Example:
{ 'url': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'num_classes': 1000, 'input_size': (3, 224, 224), 'pool_size': (7, 7), 'crop_pct': 0.875, 'interpolation': 'bilinear', 'fixed_input_size': True, 'mean': (0.485, 0.456, 0.406), 'std': (0.229, 0.224, 0.225), 'first_conv': 'conv1', 'classifier': 'fc', 'architecture': 'resnet18' }
detectors.models.vgg moduleο
VGG models for CIFAR10, CIFAR100 and SVHN datasets.
detectors.models.vit moduleο
Finetuned ViT models for CIFAR10, CIFAR100, and SVHN datasets.
Module contentsο
- detectors.models.create_transform(model: Module, is_training: bool = False)[source]ο
Create a input transformation for a given model.
Based on the default configuration of the model following timmβs library.
- Parameters:
model (torch.nn.Module) β Model to create the transformation for.
is_training (bool, optional) β Whether the transformation is for training or not. Defaults to False.
- Returns:
The transformation.
- Return type:
Callable