MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / __init__

Method __init__

slowfast/models/ptv_model_builder.py:224–243  ·  view source on GitHub ↗

The `__init__` method of any subclass should also contain these arguments. Args: cfg (CfgNode): model building configs, details are in the comments of the config file.

(self, cfg)

Source from the content-addressed store, hash-verified

222@MODEL_REGISTRY.register()
223class PTVSlowFast(nn.Module):
224 def __init__(self, cfg):
225 """
226 The `__init__` method of any subclass should also contain these
227 arguments.
228
229 Args:
230 cfg (CfgNode): model building configs, details are in the
231 comments of the config file.
232 """
233 super(PTVSlowFast, self).__init__()
234
235 assert (
236 cfg.RESNET.STRIDE_1X1 is False
237 ), "STRIDE_1x1 must be True for PTVSlowFast"
238 assert (
239 cfg.RESNET.TRANS_FUNC == "bottleneck_transform"
240 ), f"Unsupported TRANS_FUNC type {cfg.RESNET.TRANS_FUNC} for PTVSlowFast"
241
242 self.detection_mode = cfg.DETECTION.ENABLE
243 self._construct_network(cfg)
244
245 def _construct_network(self, cfg):
246 """

Callers

nothing calls this directly

Calls 2

_construct_networkMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected