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)
| 222 | @MODEL_REGISTRY.register() |
| 223 | class 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 | """ |
nothing calls this directly
no test coverage detected