vis4d.op.fpp

Vis4D modules for feature pyramid processing.

Feature pyramid processing is usually used for augmenting the existing feature maps and/or upsampling the feature maps.

class DLAUp(in_channels, out_channels=None, start_level=0, end_level=-1, use_deformable_convs=True)[source]

DLAUp.

Creates an instance of the class.

forward(features)[source]

Forward.

Return type:

list[Tensor]

class FPN(in_channels_list, out_channels, extra_blocks=LastLevelMaxPool(), start_index=2)[source]

Feature Pyramid Network.

This is a wrapper of the torchvision implementation.

Init without additional components.

Parameters:
  • in_channels_list (list[int]) – List of input channels.

  • out_channels (int) – Output channels.

  • extra_blocks (_ExtraFPNBlock, optional) – Extra block. Defaults to LastLevelMaxPool().

  • start_index (int, optional) – Start index of base model feature maps. Defaults to 2.

__call__(x)[source]

Type definition for call implementation.

Return type:

list[Tensor]

forward(x)[source]

Process the input features with FPN.

Because by default, FPN doesn’t upsample the first two feature maps in the pyramid, we keep the first two feature maps intact.

Parameters:
  • x (list[Tensor]) – Feature pyramid as outputs of the

  • model. (base)

Returns:

Feature pyramid after FPN processing.

Return type:

list[Tensor]

class FeaturePyramidProcessing(*args, **kwargs)[source]

Base Neck class.

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

__call__(features)[source]

Type definition for call implementation.

Return type:

list[Tensor]

abstract forward(features)[source]

Feature pyramid processing.

This module do a further processing for the hierarchical feature representation extracted by the base models.

Parameters:
  • features (list[Tensor]) – Feature pyramid as outputs of the

  • model. (base)

Returns:

Feature pyramid after the processing.

Return type:

list[Tensor]

class YOLOXPAFPN(in_channels, out_channels, num_csp_blocks=3, start_index=2)[source]

Path Aggregation Network used in YOLOX.

Parameters:
  • in_channels (list[int]) – Number of input channels per scale.

  • out_channels (int) – Number of output channels (used at each scale).

  • num_csp_blocks (int, optional) – Number of bottlenecks in CSPLayer. Defaults to 3.

  • start_index (int, optional) – Index of the first input feature map. Defaults to 2.

Init.

__call__(features)[source]

Type definition for call implementation.

Return type:

list[Tensor]

forward(features)[source]

Forward pass.

Parameters:

features (tuple[Tensor]) – Input features.

Returns:

YOLOXPAFPN features.

Return type:

list[Tensor]

Modules

vis4d.op.fpp.base

Feature pyramid processing base class.

vis4d.op.fpp.dla_up

DLA-UP.

vis4d.op.fpp.fpn

Feature Pyramid Network.

vis4d.op.fpp.yolox_pafpn

YOLOX PAFPN.