cvnets.neural_augmentor package

Subpackages

Submodules

cvnets.neural_augmentor.neural_aug module

class cvnets.neural_augmentor.neural_aug.BaseNeuralAugmentor(opts, *args, **kwargs)[source]

Bases: Module

Base class for neural (or range) augmentation

__init__(opts, *args, **kwargs)[source]

Initializes internal Module state, shared by both nn.Module and ScriptModule.

get_trainable_parameters(weight_decay: float | None = 0.0, no_decay_bn_filter_bias: bool | None = False, *args, **kwargs)[source]

Get trainable parameters

classmethod add_arguments(parser: ArgumentParser)[source]

Add model-specific arguments

forward(x: Tensor, *args, **kwargs) Tensor[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

class cvnets.neural_augmentor.neural_aug.BasicNeuralAugmentor(opts, *args, **kwargs)[source]

Bases: BaseNeuralAugmentor

Basic neural augmentation. This class learns per-channel augmentation parameters and apply the same parameter to all images in a batch.

See neural (or range) augmentation paper for details.

__init__(opts, *args, **kwargs) None[source]

Initializes internal Module state, shared by both nn.Module and ScriptModule.

class cvnets.neural_augmentor.neural_aug.DistributionNeuralAugmentor(opts, *args, **kwargs)[source]

Bases: BaseNeuralAugmentor

Distribution-based neural (or range) augmentation. This class samples the augmentation parameters from a specified distribution with learnable range.

See neural (or range) augmentation paper for details.

__init__(opts, *args, **kwargs) None[source]

Initializes internal Module state, shared by both nn.Module and ScriptModule.

cvnets.neural_augmentor.neural_aug.build_neural_augmentor(opts, *args, **kwargs)[source]

Module contents

cvnets.neural_augmentor.arguments_neural_augmentor(parser: ArgumentParser) ArgumentParser[source]