Skip to content

Commit

Permalink
[Refactor] Refactor configs of dgcnn for different areas (open-mmlab#…
Browse files Browse the repository at this point in the history
…1967)

* refactor configs of dgcnn

* update

* Update metafile.yml

* Refactor dgcnn

* Minor fixes in docstring

Co-authored-by: Tai-Wang <tab_wang@outlook.com>
  • Loading branch information
2 people authored and ZwwWayne committed Dec 3, 2022
1 parent 7286e97 commit 139c6f0
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 18 deletions.
18 changes: 9 additions & 9 deletions configs/dgcnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ We implement DGCNN and provide the results and checkpoints on S3DIS dataset.

### S3DIS

| Method | Split | Lr schd | Mem (GB) | Inf time (fps) | mIoU (Val set) | Download |
| :---------------------------------------------: | :----: | :---------: | :------: | :------------: | :------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | Area_1 | cosine 100e | 13.1 | | 68.33 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area1/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_000734-39658f14.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area1/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_000734.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | Area_2 | cosine 100e | 13.1 | | 40.68 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area2/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_144648-aea9ecb6.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area2/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_144648.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | Area_3 | cosine 100e | 13.1 | | 69.38 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area3/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210801_154629-2ff50ee0.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area3/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210801_154629.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | Area_4 | cosine 100e | 13.1 | | 50.07 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area4/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_073551-dffab9cd.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area4/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_073551.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | Area_5 | cosine 100e | 13.1 | | 50.59 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area5/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210730_235824-f277e0c5.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area5/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210730_235824.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | Area_6 | cosine 100e | 13.1 | | 77.94 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area6/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_154317-e3511b32.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area6/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_154317.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg.py) | 6-fold | | | | 59.43 | |
| Method | Split | Lr schd | Mem (GB) | Inf time (fps) | mIoU (Val set) | Download |
| :--------------------------------------------------------: | :----: | :---------: | :------: | :------------: | :------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg_test-area1.py) | Area_1 | cosine 100e | 13.1 | | 68.33 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area1/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_000734-39658f14.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area1/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_000734.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg_test-area2.py) | Area_2 | cosine 100e | 13.1 | | 40.68 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area2/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_144648-aea9ecb6.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area2/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_144648.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg_test-area3.py) | Area_3 | cosine 100e | 13.1 | | 69.38 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area3/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210801_154629-2ff50ee0.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area3/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210801_154629.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg_test-area4.py) | Area_4 | cosine 100e | 13.1 | | 50.07 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area4/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_073551-dffab9cd.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area4/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_073551.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py) | Area_5 | cosine 100e | 13.1 | | 50.59 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area5/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210730_235824-f277e0c5.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area5/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210730_235824.log.json) |
| [DGCNN](./dgcnn_4xb32-cosine-100e_s3dis-seg_test-area6.py) | Area_6 | cosine 100e | 13.1 | | 77.94 | [model](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area6/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_154317-e3511b32.pth) \| [log](https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area6/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_154317.log.json) |
| DGCNN | 6-fold | | | | 59.43 | |

**Notes:**

Expand Down
17 changes: 17 additions & 0 deletions configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_base_ = './dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py'

# data settings
train_area = [2, 3, 4, 5, 6]
test_area = 1
train_dataloader = dict(
batch_size=32,
dataset=dict(
ann_files=[f's3dis_infos_Area_{i}.pkl' for i in train_area],
scene_idxs=[
f'seg_info/Area_{i}_resampled_scene_idxs.npy' for i in train_area
]))
test_dataloader = dict(
dataset=dict(
ann_files=f's3dis_infos_Area_{test_area}.pkl',
scene_idxs=f'seg_info/Area_{test_area}_resampled_scene_idxs.npy'))
val_dataloader = test_dataloader
17 changes: 17 additions & 0 deletions configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_base_ = './dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py'

# data settings
train_area = [1, 3, 4, 5, 6]
test_area = 2
train_dataloader = dict(
batch_size=32,
dataset=dict(
ann_files=[f's3dis_infos_Area_{i}.pkl' for i in train_area],
scene_idxs=[
f'seg_info/Area_{i}_resampled_scene_idxs.npy' for i in train_area
]))
test_dataloader = dict(
dataset=dict(
ann_files=f's3dis_infos_Area_{test_area}.pkl',
scene_idxs=f'seg_info/Area_{test_area}_resampled_scene_idxs.npy'))
val_dataloader = test_dataloader
17 changes: 17 additions & 0 deletions configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_base_ = './dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py'

# data settings
train_area = [1, 2, 4, 5, 6]
test_area = 3
train_dataloader = dict(
batch_size=32,
dataset=dict(
ann_files=[f's3dis_infos_Area_{i}.pkl' for i in train_area],
scene_idxs=[
f'seg_info/Area_{i}_resampled_scene_idxs.npy' for i in train_area
]))
test_dataloader = dict(
dataset=dict(
ann_files=f's3dis_infos_Area_{test_area}.pkl',
scene_idxs=f'seg_info/Area_{test_area}_resampled_scene_idxs.npy'))
val_dataloader = test_dataloader
17 changes: 17 additions & 0 deletions configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_base_ = './dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py'

# data settings
train_area = [1, 2, 3, 5, 6]
test_area = 4
train_dataloader = dict(
batch_size=32,
dataset=dict(
ann_files=[f's3dis_infos_Area_{i}.pkl' for i in train_area],
scene_idxs=[
f'seg_info/Area_{i}_resampled_scene_idxs.npy' for i in train_area
]))
test_dataloader = dict(
dataset=dict(
ann_files=f's3dis_infos_Area_{test_area}.pkl',
scene_idxs=f'seg_info/Area_{test_area}_resampled_scene_idxs.npy'))
val_dataloader = test_dataloader
17 changes: 17 additions & 0 deletions configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
_base_ = './dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py'

# data settings
train_area = [1, 2, 3, 4, 5]
test_area = 6
train_dataloader = dict(
batch_size=32,
dataset=dict(
ann_files=[f's3dis_infos_Area_{i}.pkl' for i in train_area],
scene_idxs=[
f'seg_info/Area_{i}_resampled_scene_idxs.npy' for i in train_area
]))
test_dataloader = dict(
dataset=dict(
ann_files=f's3dis_infos_Area_{test_area}.pkl',
scene_idxs=f'seg_info/Area_{test_area}_resampled_scene_idxs.npy'))
val_dataloader = test_dataloader
71 changes: 68 additions & 3 deletions configs/dgcnn/metafile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,80 @@ Collections:
README: configs/dgcnn/README.md

Models:
- Name: dgcnn_4xb32-cosine-100e_s3dis-seg.py
- Name: dgcnn_4xb32-cosine-100e_s3dis-seg_test-area1.py
In Collection: DGCNN
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg.py
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area1.py
Metadata:
Training Data: S3DIS
Training Memory (GB): 13.3
Results:
- Task: 3D Semantic Segmentation
Dataset: S3DIS
Dataset: S3DIS Area1
Metrics:
mIoU: 68.33
Weights: https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area1/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_000734-39658f14.pth

- Name: dgcnn_4xb32-cosine-100e_s3dis-seg_test-area2.py
In Collection: DGCNN
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area2.py
Metadata:
Training Data: S3DIS
Training Memory (GB): 13.3
Results:
- Task: 3D Semantic Segmentation
Dataset: S3DIS Area2
Metrics:
mIoU: 40.68
Weights: https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area2/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210731_144648-aea9ecb6.pth

- Name: dgcnn_4xb32-cosine-100e_s3dis-seg_test-area3.py
In Collection: DGCNN
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area3.py
Metadata:
Training Data: S3DIS
Training Memory (GB): 13.3
Results:
- Task: 3D Semantic Segmentation
Dataset: S3DIS Area3
Metrics:
mIoU: 69.38
Weights: https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area3/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210801_154629-2ff50ee0.pth

- Name: dgcnn_4xb32-cosine-100e_s3dis-seg_test-area4.py
In Collection: DGCNN
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area4.py
Metadata:
Training Data: S3DIS
Training Memory (GB): 13.3
Results:
- Task: 3D Semantic Segmentation
Dataset: S3DIS Area4
Metrics:
mIoU: 50.07
Weights: https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area4/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_073551-dffab9cd.pth

- Name: dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py
In Collection: DGCNN
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area5.py
Metadata:
Training Data: S3DIS
Training Memory (GB): 13.3
Results:
- Task: 3D Semantic Segmentation
Dataset: S3DIS Area5
Metrics:
mIoU: 50.59
Weights: https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area5/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210730_235824-f277e0c5.pth

- Name: dgcnn_4xb32-cosine-100e_s3dis-seg_test-area6.py
In Collection: DGCNN
Config: configs/dgcnn/dgcnn_4xb32-cosine-100e_s3dis-seg_test-area6.py
Metadata:
Training Data: S3DIS
Training Memory (GB): 13.3
Results:
- Task: 3D Semantic Segmentation
Dataset: S3DIS Area6
Metrics:
mIoU: 77.94
Weights: https://download.openmmlab.com/mmdetection3d/v0.17.0_models/dgcnn/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class/area6/dgcnn_32x4_cosine_100e_s3dis_seg-3d-13class_20210802_154317-e3511b32.pth
12 changes: 6 additions & 6 deletions mmdet3d/models/decode_heads/decode_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def __init__(self,
else:
self.dropout = None

self.fp16_enabled = False

def init_weights(self):
"""Initialize weights of classification layer."""
super().init_weights()
Expand All @@ -112,9 +110,9 @@ def loss(self, inputs: List[Tensor], batch_data_samples: SampleList,
Args:
inputs (list[torch.Tensor]): List of multi-level point features.
img_metas (list[dict]): Meta information of each sample.
pts_semantic_mask (torch.Tensor): Semantic segmentation masks
used if the architecture supports semantic segmentation task.
batch_data_samples (List[:obj:`Det3DDataSample`]): The seg
data samples. It usually includes information such
as `metainfo` and `gt_pts_seg`.
train_cfg (dict): The training config.
Returns:
Expand All @@ -130,7 +128,9 @@ def predict(self, inputs: List[Tensor], batch_input_metas: List[dict],
Args:
inputs (list[Tensor]): List of multi-level point features.
batch_img_metas (list[dict]): Meta information of each sample.
batch_data_samples (List[:obj:`Det3DDataSample`]): The seg
data samples. It usually includes information such
as `metainfo` and `gt_pts_seg`.
test_cfg (dict): The testing config.
Returns:
Expand Down

0 comments on commit 139c6f0

Please sign in to comment.