Unverified Commit e3a24b79 authored by Danila Rukhovich's avatar Danila Rukhovich Committed by GitHub
Browse files

[Fix] Fix docstrings and README (#2280)

* docstrings and .md fixes

* add minkresnet to readme

* fix cross in zh readme

* fix lint
parent 8398af33
......@@ -60,15 +60,15 @@ a part of the OpenMMLab project developed by [MMLab](http://mmlab.ie.cuhk.edu.hk
- **High efficiency**
It trains faster than other codebases. The main results are as below. Details can be found in [benchmark.md](./docs/en/notes/benchmarks.md). We compare the number of samples trained per second (the higher, the better). The models that are not supported by other codebases are marked by `×`.
It trains faster than other codebases. The main results are as below. Details can be found in [benchmark.md](./docs/en/notes/benchmarks.md). We compare the number of samples trained per second (the higher, the better). The models that are not supported by other codebases are marked by ``.
| Methods | MMDetection3D | [OpenPCDet](https://github.com/open-mmlab/OpenPCDet) | [votenet](https://github.com/facebookresearch/votenet) | [Det3D](https://github.com/poodarchu/Det3D) |
| :-----------------: | :-----------: | :--------------------------------------------------: | :----------------------------------------------------: | :-----------------------------------------: |
| VoteNet | 358 | × | 77 | × |
| PointPillars-car | 141 | × | × | 140 |
| PointPillars-3class | 107 | 44 | × | × |
| SECOND | 40 | 30 | × | × |
| Part-A2 | 17 | 14 | × | × |
| VoteNet | 358 | | 77 | |
| PointPillars-car | 141 | | | 140 |
| PointPillars-3class | 107 | 44 | | |
| SECOND | 40 | 30 | | |
| Part-A2 | 17 | 14 | | |
Like [MMDetection](https://github.com/open-mmlab/mmdetection) and [MMCV](https://github.com/open-mmlab/mmcv), MMDetection3D can also be used as a library to support different projects on top of it.
......@@ -110,6 +110,7 @@ Results and models are available in the [model zoo](docs/en/model_zoo.md).
<li><a href="configs/regnet">RegNet (CVPR'2020)</a></li>
<li><a href="configs/dgcnn">DGCNN (TOG'2019)</a></li>
<li>DLA (CVPR'2018)</li>
<li>MinkResNet (CVPR'2019)</li>
</ul>
</td>
<td>
......@@ -178,6 +179,10 @@ Results and models are available in the [model zoo](docs/en/model_zoo.md).
<li><a href="configs/pgd">PGD (CoRL'2021)</a></li>
<li><a href="configs/monoflex">MonoFlex (CVPR'2021)</a></li>
</ul>
<li><b>Indoor</b></li>
<ul>
<li><a href="configs/imvoxelnet">ImVoxelNet (WACV'2022)</a></li>
</ul>
</td>
<td>
<li><b>Outdoor</b></li>
......@@ -204,31 +209,31 @@ Results and models are available in the [model zoo](docs/en/model_zoo.md).
</tbody>
</table>
| | ResNet | ResNeXt | SENet | PointNet++ | DGCNN | HRNet | RegNetX | Res2Net | DLA | MinkResNet |
| ------------- | :----: | :-----: | :---: | :--------: | :---: | :---: | :-----: | :-----: | :-: | :--------: |
| SECOND | | | ☐ | | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| PointPillars | | | ☐ | | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| FreeAnchor | | | ☐ | | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| VoteNet | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| H3DNet | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| 3DSSD | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| Part-A2 | | | ☐ | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| MVXNet | | | ☐ | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| CenterPoint | | | | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| SSN | | | ☐ | | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| ImVoteNet | | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| FCOS3D | ✓ | | ☐ | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| PointNet++ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| Group-Free-3D | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| ImVoxelNet | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| PAConv | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | | ✗ | ✗ | ✗ |
| DGCNN | ✗ | ✗ | ✗ | | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| SMOKE | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | ✗ | ✓ | ✗ |
| PGD | ✓ | | ☐ | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| MonoFlex | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | ✗ | ✓ | ✗ |
| SA-SSD | | | ☐ | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| FCAF3D | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | | ✗ | ✗ | ✓ |
| PV-RCNN | | | ☐ | | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| | ResNet | PointNet++ | SECOND | DGCNN | RegNetX | DLA | MinkResNet |
| :-----------: | :----: | :--------: | :----: | :---: | :-----: | :-: | :--------: |
| SECOND | | | | ✗ | | ✗ | ✗ |
| PointPillars | | | | ✗ | | ✗ | ✗ |
| FreeAnchor | | | | ✗ | | ✗ | ✗ |
| VoteNet | ✗ | ✓ | ✗ | | ✗ | ✗ | ✗ |
| H3DNet | ✗ | ✓ | ✗ | | ✗ | ✗ | ✗ |
| 3DSSD | ✗ | ✓ | ✗ | | ✗ | ✗ | ✗ |
| Part-A2 | | | | ✗ | | ✗ | ✗ |
| MVXNet | | | | ✗ | | ✗ | ✗ |
| CenterPoint | | | | ✗ | | ✗ | ✗ |
| SSN | | | | ✗ | | ✗ | ✗ |
| ImVoteNet | | ✓ | ✗ | | ✗ | ✗ | ✗ |
| FCOS3D | ✓ | | | ✗ | | ✗ | ✗ |
| PointNet++ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Group-Free-3D | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| ImVoxelNet | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| PAConv | ✗ | ✓ | ✗ | | ✗ | ✗ | ✗ |
| DGCNN | ✗ | ✗ | | ✓ | ✗ | ✗ | ✗ |
| SMOKE | ✗ | ✗ | ✗ | | ✗ | ✓ | ✗ |
| PGD | ✓ | | | ✗ | | ✗ | ✗ |
| MonoFlex | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |
| SA-SSD | | | | ✗ | | ✗ | ✗ |
| FCAF3D | ✗ | ✗ | ✗ | | ✗ | ✗ | ✓ |
| PV-RCNN | | | | ✗ | | ✗ | ✗ |
**Note:** All the about **300+ models, methods of 40+ papers** in 2D detection supported by [MMDetection](https://github.com/open-mmlab/mmdetection/blob/3.x/docs/en/model_zoo.md) can be trained or used in this codebase.
......
......@@ -59,15 +59,15 @@ MMDetection3D 是一个基于 PyTorch 的目标检测开源工具箱,下一代
- **性能高**
训练速度比其他代码库更快。下表可见主要的对比结果。更多的细节可见[基准测评文档](./docs/zh_cn/notes/benchmarks.md)。我们对比了每秒训练的样本数(值越高越好)。其他代码库不支持的模型被标记为 `×`
训练速度比其他代码库更快。下表可见主要的对比结果。更多的细节可见[基准测评文档](./docs/zh_cn/notes/benchmarks.md)。我们对比了每秒训练的样本数(值越高越好)。其他代码库不支持的模型被标记为 ``
| Methods | MMDetection3D | [OpenPCDet](https://github.com/open-mmlab/OpenPCDet) | [votenet](https://github.com/facebookresearch/votenet) | [Det3D](https://github.com/poodarchu/Det3D) |
| :-----------------: | :-----------: | :--------------------------------------------------: | :----------------------------------------------------: | :-----------------------------------------: |
| VoteNet | 358 | × | 77 | × |
| PointPillars-car | 141 | × | × | 140 |
| PointPillars-3class | 107 | 44 | × | × |
| SECOND | 40 | 30 | × | × |
| Part-A2 | 17 | 14 | × | × |
| VoteNet | 358 | | 77 | |
| PointPillars-car | 141 | | | 140 |
| PointPillars-3class | 107 | 44 | | |
| SECOND | 40 | 30 | | |
| Part-A2 | 17 | 14 | | |
[MMDetection](https://github.com/open-mmlab/mmdetection)[MMCV](https://github.com/open-mmlab/mmcv) 一样,MMDetection3D 也可以作为一个库去支持各式各样的项目。
......@@ -109,6 +109,7 @@ MMDetection3D 是一个基于 PyTorch 的目标检测开源工具箱,下一代
<li><a href="configs/regnet">RegNet (CVPR'2020)</a></li>
<li><a href="configs/dgcnn">DGCNN (TOG'2019)</a></li>
<li>DLA (CVPR'2018)</li>
<li>MinkResNet (CVPR'2019)</li>
</ul>
</td>
<td>
......@@ -176,6 +177,10 @@ MMDetection3D 是一个基于 PyTorch 的目标检测开源工具箱,下一代
<li><a href="configs/pgd">PGD (CoRL'2021)</a></li>
<li><a href="configs/monoflex">MonoFlex (CVPR'2021)</a></li>
</ul>
<li><b>Indoor</b></li>
<ul>
<li><a href="configs/imvoxelnet">ImVoxelNet (WACV'2022)</a></li>
</ul>
</td>
<td>
<li><b>室外</b></li>
......@@ -202,30 +207,31 @@ MMDetection3D 是一个基于 PyTorch 的目标检测开源工具箱,下一代
</tbody>
</table>
| | ResNet | ResNeXt | SENet | PointNet++ | DGCNN | HRNet | RegNetX | Res2Net | DLA | MinkResNet |
| ------------- | :----: | :-----: | :---: | :--------: | :---: | :---: | :-----: | :-----: | :-: | :--------: |
| SECOND | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| PointPillars | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| FreeAnchor | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| VoteNet | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| H3DNet | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| 3DSSD | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Part-A2 | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| MVXNet | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| CenterPoint | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| SSN | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ✓ | ☐ | ✗ | ✗ |
| ImVoteNet | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| FCOS3D | ✓ | ☐ | ☐ | ✗ | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| PointNet++ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Group-Free-3D | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| ImVoxelNet | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| PAConv | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| DGCNN | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| SMOKE | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |
| PGD | ✓ | ☐ | ☐ | ✗ | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| MonoFlex | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |
| SA-SSD | ☐ | ☐ | ☐ | ✗ | ✗ | ☐ | ☐ | ☐ | ✗ | ✗ |
| FCAF3D | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
| | ResNet | PointNet++ | SECOND | DGCNN | RegNetX | DLA | MinkResNet |
| :-----------: | :----: | :--------: | :----: | :---: | :-----: | :-: | :--------: |
| SECOND | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
| PointPillars | ✗ | ✗ | ✓ | ✗ | ✓ | ✗ | ✗ |
| FreeAnchor | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ |
| VoteNet | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| H3DNet | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| 3DSSD | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Part-A2 | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
| MVXNet | ✓ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
| CenterPoint | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
| SSN | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ |
| ImVoteNet | ✓ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| FCOS3D | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| PointNet++ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| Group-Free-3D | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| ImVoxelNet | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| PAConv | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ |
| DGCNN | ✗ | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ |
| SMOKE | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |
| PGD | ✓ | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ |
| MonoFlex | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ | ✗ |
| SA-SSD | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
| FCAF3D | ✗ | ✗ | ✗ | ✗ | ✗ | ✗ | ✓ |
| PV-RCNN | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ |
**注意:**[MMDetection](https://github.com/open-mmlab/mmdetection/blob/3.x/docs/zh_cn/model_zoo.md) 支持的基于 2D 检测的 **300+ 个模型,40+ 的论文算法**在 MMDetection3D 中都可以被训练或使用。
......
......@@ -22,24 +22,24 @@ We implement FCAF3D and provide the result and checkpoints on the ScanNet and SU
| Backbone | Mem (GB) | Inf time (fps) | AP@0.25 | AP@0.5 | Download |
| :------------------------------------------------: | :------: | :------------: | :----------: | :----------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [MinkResNet34](./fcaf3d_8x2_scannet-3d-18class.py) | 10.5 | 8.0 | 69.7(70.7\*) | 55.2(56.0\*) | [model](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_scannet-3d-18class/fcaf3d_8x2_scannet-3d-18class_20220805_084956.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_scannet-3d-18class/fcaf3d_8x2_scannet-3d-18class_20220805_084956.log.json) |
| [MinkResNet34](./fcaf3d_8x2_scannet-3d-18class.py) | 10.5 | 15.7 | 69.7(70.7\*) | 55.2(56.0\*) | [model](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_scannet-3d-18class/fcaf3d_8x2_scannet-3d-18class_20220805_084956.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_scannet-3d-18class/fcaf3d_8x2_scannet-3d-18class_20220805_084956.log.json) |
### SUN RGB-D
| Backbone | Mem (GB) | Inf time (fps) | AP@0.25 | AP@0.5 | Download |
| :------------------------------------------------: | :------: | :------------: | :----------: | :----------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [MinkResNet34](./fcaf3d_8x2_sunrgbd-3d-10class.py) | 6.3 | 15.6 | 63.8(63.8\*) | 47.3(48.2\*) | [model](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_sunrgbd-3d-10class/fcaf3d_8x2_sunrgbd-3d-10class_20220805_165017.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_sunrgbd-3d-10class/fcaf3d_8x2_sunrgbd-3d-10class_20220805_165017.log.json) |
| [MinkResNet34](./fcaf3d_8x2_sunrgbd-3d-10class.py) | 6.3 | 17.9 | 63.8(63.8\*) | 47.3(48.2\*) | [model](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_sunrgbd-3d-10class/fcaf3d_8x2_sunrgbd-3d-10class_20220805_165017.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_sunrgbd-3d-10class/fcaf3d_8x2_sunrgbd-3d-10class_20220805_165017.log.json) |
### S3DIS
| Backbone | Mem (GB) | Inf time (fps) | AP@0.25 | AP@0.5 | Download |
| :----------------------------------------------: | :------: | :------------: | :----------: | :----------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [MinkResNet34](./fcaf3d_2xb8_s3dis-3d-5class.py) | 23.5 | 4.2 | 67.4(64.9\*) | 45.7(43.8\*) | [model](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_s3dis-3d-5class/fcaf3d_8x2_s3dis-3d-5class_20220805_121957.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_s3dis-3d-5class/fcaf3d_8x2_s3dis-3d-5class_20220805_121957.log.json) |
| [MinkResNet34](./fcaf3d_2xb8_s3dis-3d-5class.py) | 23.5 | 10.9 | 67.4(64.9\*) | 45.7(43.8\*) | [model](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_s3dis-3d-5class/fcaf3d_8x2_s3dis-3d-5class_20220805_121957.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v1.0.0_models/fcaf3d/fcaf3d_8x2_s3dis-3d-5class/fcaf3d_8x2_s3dis-3d-5class_20220805_121957.log.json) |
**Note**
- We report the results across 5 train runs followed by 5 test runs. * means the results reported in the paper.
- Inference time is given for a single NVidia GeForce GTX 1080 Ti GPU. All models are trained on 2 GPUs.
- Inference time is given for a single NVidia RTX 4090 GPU. All models are trained on 2 GPUs.
## Citation
......
# Copyright (c) OpenMMLab. All rights reserved.
# Follow https://github.com/NVIDIA/MinkowskiEngine/blob/master/examples/resnet.py # noqa
# and mmcv.cnn.ResNet
from typing import List, Union
try:
import MinkowskiEngine as ME
from MinkowskiEngine import SparseTensor
from MinkowskiEngine.modules.resnet_block import BasicBlock, Bottleneck
except ImportError:
# blocks are used in the static part of MinkResNet
ME = BasicBlock = Bottleneck = None
ME = BasicBlock = Bottleneck = SparseTensor = None
import torch.nn as nn
from mmengine.model import BaseModule
from mmdet3d.registry import MODELS
@MODELS.register_module()
class MinkResNet(nn.Module):
class MinkResNet(BaseModule):
r"""Minkowski ResNet backbone. See `4D Spatio-Temporal ConvNets
<https://arxiv.org/abs/1904.08755>`_ for more details.
......@@ -33,7 +37,11 @@ class MinkResNet(nn.Module):
152: (Bottleneck, (3, 8, 36, 3))
}
def __init__(self, depth, in_channels, num_stages=4, pool=True):
def __init__(self,
depth: int,
in_channels: int,
num_stages: int = 4,
pool: bool = True):
super(MinkResNet, self).__init__()
if ME is None:
raise ImportError(
......@@ -57,12 +65,13 @@ class MinkResNet(nn.Module):
self.maxpool = ME.MinkowskiMaxPooling(
kernel_size=2, stride=2, dimension=3)
for i, num_blocks in enumerate(stage_blocks):
for i in range(len(stage_blocks)):
setattr(
self, f'layer{i + 1}',
self._make_layer(block, 64 * 2**i, stage_blocks[i], stride=2))
def init_weights(self):
"""Initialize weights."""
for m in self.modules():
if isinstance(m, ME.MinkowskiConvolution):
ME.utils.kaiming_normal_(
......@@ -72,7 +81,19 @@ class MinkResNet(nn.Module):
nn.init.constant_(m.bn.weight, 1)
nn.init.constant_(m.bn.bias, 0)
def _make_layer(self, block, planes, blocks, stride):
def _make_layer(self, block: Union[BasicBlock, Bottleneck], planes: int,
blocks: int, stride: int) -> nn.Module:
"""Make single level of residual blocks.
Args:
block (BasicBlock | Bottleneck): Residual block class.
planes (int): Number of convolution filters.
blocks (int): Number of blocks in the layers.
stride (int): Stride of the first convolutional layer.
Returns:
nn.Module: With residual blocks.
"""
downsample = None
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
......@@ -92,11 +113,11 @@ class MinkResNet(nn.Module):
downsample=downsample,
dimension=3))
self.inplanes = planes * block.expansion
for i in range(1, blocks):
for _ in range(1, blocks):
layers.append(block(self.inplanes, planes, stride=1, dimension=3))
return nn.Sequential(*layers)
def forward(self, x):
def forward(self, x: SparseTensor) -> List[SparseTensor]:
"""Forward pass of ResNet.
Args:
......
......@@ -34,7 +34,7 @@ class FCAF3DHead(Base3DDenseHead):
Args:
num_classes (int): Number of classes.
in_channels (int): Number of channels in input tensors.
in_channels (tuple(int)): Number of channels in input tensors.
out_channels (int): Number of channels in the neck output tensors.
num_reg_outs (int): Number of regression layer channels.
voxel_size (float): Voxel size in meters.
......@@ -59,7 +59,7 @@ class FCAF3DHead(Base3DDenseHead):
def __init__(self,
num_classes: int,
in_channels: int,
in_channels: Tuple[int],
out_channels: int,
num_reg_outs: int,
voxel_size: float,
......@@ -340,8 +340,8 @@ class FCAF3DHead(Base3DDenseHead):
batch_gt_instances_3d (list[:obj:`InstanceData`]): Batch of
gt_instance_3d. It usually includes ``bboxes_3d``、`
`labels_3d``、``depths``、``centers_2d`` and attributes.
batch_img_metas (list[dict]): Meta information of each image, e.g.,
image size, scaling factor, etc.
batch_input_metas (list[dict]): Meta information of each input,
e.g., image size, scaling factor, etc.
batch_gt_instances_ignore (list[:obj:`InstanceData`], optional):
Batch of gt_instances_ignore. It includes ``bboxes`` attribute
data that is ignored during training and testing.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment