From c5c1499050250e9f18b419b4974802bb309c4df9 Mon Sep 17 00:00:00 2001 From: xiexinch Date: Tue, 14 Mar 2023 10:31:14 +0800 Subject: [PATCH] refine doc --- configs/pidnet/README.md | 8 ++++---- configs/pidnet/pidnet.yml | 6 +++--- mmseg/models/losses/boundary_loss.py | 10 +++++----- mmseg/models/losses/ohem_cross_entropy_loss.py | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/configs/pidnet/README.md b/configs/pidnet/README.md index 38bdf3df73..545b76e8b0 100644 --- a/configs/pidnet/README.md +++ b/configs/pidnet/README.md @@ -19,7 +19,7 @@ Two-branch network architecture has shown its efficiency and effectiveness for r
- +
## Results and models @@ -28,9 +28,9 @@ Two-branch network architecture has shown its efficiency and effectiveness for r | Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | config | download | | ------ | -------- | --------- | ------- | -------- | -------------- | ----- | ------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| PIDNet | PIDNet-S | 1024x1024 | 120000 | 3466 | 80.82 | 78.74 | 80.87 | [config](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/pidnet/pidnet-s_2xb6-120k_1024x1024-cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-s_2xb6-120k_1024x1024-cityscapes/pidnet-s_2xb6-120k_1024x1024-cityscapes_20230302_191700-bb8e3bcc.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-s_2xb6-120k_1024x1024-cityscapes/pidnet-s_2xb6-120k_1024x1024-cityscapes_20230302_191700.json) | -| PIDNet | PIDNet-M | 1024x1024 | 120000 | 5260 | 71.98 | 80.22 | 82.05 | [config](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/pidnet/pidnet-m_2xb6-120k_1024x1024-cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-m_2xb6-120k_1024x1024-cityscapes/pidnet-m_2xb6-120k_1024x1024-cityscapes_20230301_143452-f9bcdbf3.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-m_2xb6-120k_1024x1024-cityscapes/pidnet-m_2xb6-120k_1024x1024-cityscapes_20230301_143452.json) | -| PIDNet | PIDNet-L | 1024x1024 | 120000 | 5970 | 60.06 | 80.89 | 82.37 | [config](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/pidnet/pidnet-l_2xb6-120k_1024x1024-cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-l_2xb6-120k_1024x1024-cityscapes/pidnet-l_2xb6-120k_1024x1024-cityscapes_20230303_114514-0783ca6b.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-l_2xb6-120k_1024x1024-cityscapes/pidnet-l_2xb6-120k_1024x1024-cityscapes_20230303_114514.json) | +| PIDNet | PIDNet-S | 1024x1024 | 120000 | 3.38 | 80.82 | 78.74 | 80.87 | [config](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/pidnet/pidnet-s_2xb6-120k_1024x1024-cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-s_2xb6-120k_1024x1024-cityscapes/pidnet-s_2xb6-120k_1024x1024-cityscapes_20230302_191700-bb8e3bcc.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-s_2xb6-120k_1024x1024-cityscapes/pidnet-s_2xb6-120k_1024x1024-cityscapes_20230302_191700.json) | +| PIDNet | PIDNet-M | 1024x1024 | 120000 | 5.14 | 71.98 | 80.22 | 82.05 | [config](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/pidnet/pidnet-m_2xb6-120k_1024x1024-cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-m_2xb6-120k_1024x1024-cityscapes/pidnet-m_2xb6-120k_1024x1024-cityscapes_20230301_143452-f9bcdbf3.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-m_2xb6-120k_1024x1024-cityscapes/pidnet-m_2xb6-120k_1024x1024-cityscapes_20230301_143452.json) | +| PIDNet | PIDNet-L | 1024x1024 | 120000 | 5.83 | 60.06 | 80.89 | 82.37 | [config](https://github.com/open-mmlab/mmsegmentation/blob/dev-1.x/configs/pidnet/pidnet-l_2xb6-120k_1024x1024-cityscapes.py) | [model](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-l_2xb6-120k_1024x1024-cityscapes/pidnet-l_2xb6-120k_1024x1024-cityscapes_20230303_114514-0783ca6b.pth) \| [log](https://download.openmmlab.com/mmsegmentation/v0.5/pidnet/pidnet-l_2xb6-120k_1024x1024-cityscapes/pidnet-l_2xb6-120k_1024x1024-cityscapes_20230303_114514.json) | ## Notes diff --git a/configs/pidnet/pidnet.yml b/configs/pidnet/pidnet.yml index dae82338d0..7fe818ca7c 100644 --- a/configs/pidnet/pidnet.yml +++ b/configs/pidnet/pidnet.yml @@ -26,7 +26,7 @@ Models: batch size: 1 mode: FP32 resolution: (1024,1024) - Training Memory (GB): 3466.0 + Training Memory (GB): 3.38 Results: - Task: Semantic Segmentation Dataset: Cityscapes @@ -48,7 +48,7 @@ Models: batch size: 1 mode: FP32 resolution: (1024,1024) - Training Memory (GB): 5260.0 + Training Memory (GB): 5.14 Results: - Task: Semantic Segmentation Dataset: Cityscapes @@ -70,7 +70,7 @@ Models: batch size: 1 mode: FP32 resolution: (1024,1024) - Training Memory (GB): 5970.0 + Training Memory (GB): 5.83 Results: - Task: Semantic Segmentation Dataset: Cityscapes diff --git a/mmseg/models/losses/boundary_loss.py b/mmseg/models/losses/boundary_loss.py index c65c5833ce..e86b850d87 100644 --- a/mmseg/models/losses/boundary_loss.py +++ b/mmseg/models/losses/boundary_loss.py @@ -32,12 +32,12 @@ def __init__(self, def forward(self, bd_pre: Tensor, bd_gt: Tensor) -> Tensor: """Forward function. - Args: - bd_pre (Tensor): Predictions of the boundary head. - bd_gt (Tensor): Ground truth of the boundary. + Args: + bd_pre (Tensor): Predictions of the boundary head. + bd_gt (Tensor): Ground truth of the boundary. - Returns: - Tensor: Loss tensor. + Returns: + Tensor: Loss tensor. """ log_p = bd_pre.permute(0, 2, 3, 1).contiguous().view(1, -1) target_t = bd_gt.view(1, -1).float() diff --git a/mmseg/models/losses/ohem_cross_entropy_loss.py b/mmseg/models/losses/ohem_cross_entropy_loss.py index 1c253b5b4c..a519b4d84e 100644 --- a/mmseg/models/losses/ohem_cross_entropy_loss.py +++ b/mmseg/models/losses/ohem_cross_entropy_loss.py @@ -51,12 +51,12 @@ def __init__(self, def forward(self, score: Tensor, target: Tensor) -> Tensor: """Forward function. - Args: - score (Tensor): Predictions of the segmentation head. - target (Tensor): Ground truth of the image. + Args: + score (Tensor): Predictions of the segmentation head. + target (Tensor): Ground truth of the image. - Returns: - Tensor: Loss tensor. + Returns: + Tensor: Loss tensor. """ # score: (N, C, H, W) pred = F.softmax(score, dim=1)