cvnets.models package
Subpackages
- cvnets.models.audio_classification package
- cvnets.models.classification package
- Subpackages
- cvnets.models.classification.config package
- Submodules
- cvnets.models.classification.config.byteformer module
- cvnets.models.classification.config.efficientnet module
- cvnets.models.classification.config.fastvit module
- cvnets.models.classification.config.mobilenetv1 module
- cvnets.models.classification.config.mobilenetv2 module
- cvnets.models.classification.config.mobilenetv3 module
- cvnets.models.classification.config.mobileone module
- cvnets.models.classification.config.mobilevit module
- cvnets.models.classification.config.mobilevit_v2 module
- cvnets.models.classification.config.regnet module
- cvnets.models.classification.config.resnet module
- cvnets.models.classification.config.swin_transformer module
- cvnets.models.classification.config.vit module
- Module contents
- cvnets.models.classification.config package
- Submodules
- cvnets.models.classification.base_image_encoder module
BaseImageEncoder
BaseImageEncoder.__init__()
BaseImageEncoder.add_arguments()
BaseImageEncoder.check_model()
BaseImageEncoder.update_classifier()
BaseImageEncoder.extract_end_points_all()
BaseImageEncoder.extract_end_points_l4()
BaseImageEncoder.extract_features()
BaseImageEncoder.forward_classifier()
BaseImageEncoder.forward()
BaseImageEncoder.get_trainable_parameters()
BaseImageEncoder.dummy_input_and_label()
BaseImageEncoder.get_exportable_model()
BaseImageEncoder.build_model()
set_model_specific_opts_before_model_building()
unset_model_specific_opts_after_model_building()
- cvnets.models.classification.byteformer module
- cvnets.models.classification.efficientnet module
- cvnets.models.classification.fastvit module
- cvnets.models.classification.mobilenetv1 module
- cvnets.models.classification.mobilenetv2 module
- cvnets.models.classification.mobilenetv3 module
- cvnets.models.classification.mobileone module
- cvnets.models.classification.mobilevit module
- cvnets.models.classification.mobilevit_v2 module
- cvnets.models.classification.regnet module
- cvnets.models.classification.resnet module
- cvnets.models.classification.swin_transformer module
- cvnets.models.classification.vit module
VisionTransformer
VisionTransformer.__init__()
VisionTransformer.update_layer_norm_eps()
VisionTransformer.reset_simple_fpn_params()
VisionTransformer.add_arguments()
VisionTransformer.extract_patch_embeddings()
VisionTransformer.extract_features()
VisionTransformer.forward_classifier()
VisionTransformer.forward()
VisionTransformer.extract_end_points_all()
- Module contents
- Subpackages
- cvnets.models.detection package
- Subpackages
- Submodules
- cvnets.models.detection.base_detection module
- cvnets.models.detection.mask_rcnn module
MaskRCNNEncoder
MaskRCNNDetector
MaskRCNNDetector.__init__()
MaskRCNNDetector.update_layer_norm_eps()
MaskRCNNDetector.set_norm_layer_opts()
MaskRCNNDetector.reset_norm_layer_opts()
MaskRCNNDetector.add_arguments()
MaskRCNNDetector.reset_generalized_rcnn_transform()
MaskRCNNDetector.get_trainable_parameters()
MaskRCNNDetector.forward()
MaskRCNNDetector.predict()
MaskRCNNDetector.dummy_input_and_label()
- cvnets.models.detection.ssd module
SingleShotMaskDetector
SingleShotMaskDetector.coordinates
SingleShotMaskDetector.__init__()
SingleShotMaskDetector.add_arguments()
SingleShotMaskDetector.reset_layers()
SingleShotMaskDetector.process_anchors_ar()
SingleShotMaskDetector.get_backbone_features()
SingleShotMaskDetector.ssd_forward()
SingleShotMaskDetector.forward()
SingleShotMaskDetector.predict()
SingleShotMaskDetector.postprocess_detections()
SingleShotMaskDetector.dummy_input_and_label()
- Module contents
- cvnets.models.multi_modal_img_text package
- cvnets.models.segmentation package
Submodules
cvnets.models.base_model module
- class cvnets.models.base_model.BaseAnyNNModel(opts, *args, **kwargs)[source]
Bases:
Module
Base class for any neural network
- __init__(opts, *args, **kwargs) None [source]
Initializes internal Module state, shared by both nn.Module and ScriptModule.
- forward(x: Any, *args, **kwargs) Any [source]
Implement the model-specific forward function in sub-classes.
- get_trainable_parameters(weight_decay: float = 0.0, no_decay_bn_filter_bias: bool = False, module_name: str = '', *args, **kwargs) Tuple[List[Mapping], List[float]] [source]
Get parameters for training along with the learning rate.
- Parameters:
weight_decay – weight decay
no_decay_bn_filter_bias – Do not decay BN and biases. Defaults to False.
- Returns:
Returns a tuple of length 2. The first entry is a list of dictionary with three keys (params, weight_decay, param_names). The second entry is a list of floats containing learning rate for each parameter.
Note
Kwargs may contain module_name. To avoid multiple arguments with the same name, we pop it and concatenate with encoder or head name
- dummy_input_and_label(batch_size: int) Dict [source]
Create dummy input and labels for CI/CD purposes. Child classes should implement it.
- get_exportable_model() Module [source]
This function can be used to prepare the architecture for inference. For example, re-parameterizing branches when possible. The functionality of this method may vary from model to model, so child model classes have to implement this method, if such a transformation exists.
- classmethod freeze_norm_layers(opts: Namespace, model: BaseAnyNNModel) None [source]
Freeze normalization layers in the model
- Parameters:
opts – Command-line arguments
model – An instance of BaseAnyNNModel
- classmethod build_model(opts: Namespace, *args, **kwargs) BaseAnyNNModel [source]
Build a model from command-line arguments. Sub-classes must implement this method
- Parameters:
opts – Command-line arguments
- …note::
This function is typically implemented in the base class for each task and implementation is reused by all models in that task.
Module contents
- cvnets.models.get_model(opts: Namespace, category: str | None = None, model_name: str | None = None, *args, **kwargs) BaseAnyNNModel [source]
Create a task-specific model from command-line arguments. If model category (or task) and name are passed as an argument, then they are used. Otherwise, dataset.category and model.{category}.name are read from command-line arguments to read model category and name, respectively.
- Parameters:
opts – Command-line arguments
category – Category or task (e.g., segmentation)
model_name – Model name for a specific task (e.g., vit for classification)
- Returns:
An instance of cvnets.models.BaseAnyNNModel.