-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Pascal Context to mmsegmentation #133
Conversation
Codecov Report
@@ Coverage Diff @@
## master #133 +/- ##
=======================================
Coverage 83.03% 83.04%
=======================================
Files 84 85 +1
Lines 3968 3980 +12
Branches 625 627 +2
=======================================
+ Hits 3295 3305 +10
- Misses 539 541 +2
Partials 134 134
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
mmseg/__init__.py
Outdated
@@ -2,7 +2,7 @@ | |||
|
|||
from .version import __version__, version_info | |||
|
|||
MMCV_MIN = '1.1.2' | |||
MMCV_MIN = '1.1.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may keep this file unchanged.
mmseg/datasets/pascal_context.py
Outdated
''' | ||
PALETTE is testing | ||
''' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may remove this line if the palette works fine.
@@ -91,7 +91,7 @@ def encode_decode(self, img, img_metas): | |||
size=img.shape[2:], | |||
mode='bilinear', | |||
align_corners=self.align_corners) | |||
return out | |||
return out.exp() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return out.exp() | |
return out |
# assert h_crop <= h_img and w_crop <= w_img, ( | ||
# 'crop size should not greater than image size') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines could be removed. We may also add comments about what would happen if h_crop > h_img
.
run.sh
Outdated
@@ -0,0 +1,15 @@ | |||
GPUS=8 GPUS_PER_NODE=8 CPUS_PER_TASK=1 tools/slurm_train.sh mediaf pr_test configs/hrnet/fcn_hr48_480x480_40k_pascal_context.py --seed=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is not necessary.
tools/slurm_test.sh
Outdated
@@ -21,4 +21,4 @@ srun -p ${PARTITION} \ | |||
--cpus-per-task=${CPUS_PER_TASK} \ | |||
--kill-on-bad-exit=1 \ | |||
${SRUN_ARGS} \ | |||
python -u tools/test.py ${CONFIG} ${CHECKPOINT} --launcher="slurm" ${PY_ARGS} | |||
python -u tools/test.py ${CONFIG} ${CHECKPOINT} --launcher="slurm" ${PY_ARGS} & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary modification.
tools/slurm_train.sh
Outdated
@@ -20,4 +20,4 @@ srun -p ${PARTITION} \ | |||
--cpus-per-task=${CPUS_PER_TASK} \ | |||
--kill-on-bad-exit=1 \ | |||
${SRUN_ARGS} \ | |||
python -u tools/train.py ${CONFIG} --launcher="slurm" ${PY_ARGS} | |||
python -u tools/train.py ${CONFIG} --launcher="slurm" ${PY_ARGS} & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary modification.
tools/test.py
Outdated
if 'CLASSES' not in checkpoint['meta']: | ||
model.CLASSES = dataset.CLASSES | ||
else: | ||
model.CLASSES = checkpoint['meta']['CLASSES'] | ||
|
||
if 'PALETTE' not in checkpoint['meta']: | ||
model.PALETTE = dataset.PALETTE | ||
else: | ||
model.PALETTE = checkpoint['meta']['PALETTE'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary modification.
# optimizer | ||
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) | ||
optimizer_config = dict() | ||
# learning policy | ||
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) | ||
# runtime settings | ||
total_iters = 40000 | ||
checkpoint_config = dict(by_epoch=False, interval=4000) | ||
evaluation = dict(interval=4000, metric='mIoU') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may delete this file and modify the corresponding lr directly.
optimizer = dict(type='SGD', lr=0.004, momentum=0.9, weight_decay=0.0001) | ||
optimizer_config = dict() | ||
# learning policy | ||
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may delete this file and modify the corresponding lr directly.
I have resolved all the problems, please review. |
update hint Co-authored-by: Jerry Jiarui XU <[email protected]>
Here is the update comment version. |
configs/deeplabv3/README.md
Outdated
### Pascal Context | ||
| Method | Backbone | Crop Size | Lr schd | Mem (GB) | Inf time (fps) | mIoU | mIoU(ms+flip) | download | | ||
|-----------|----------|-----------|--------:|----------|----------------|------:|--------------:|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ||
| DeepLabV3 | R-101-D8 | 480x480 | 40000 | 9.2 | 7.09 | 46.55 | 47.81 | [model](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context/deeplabv3_r101-d8_480x480_40k_pascal_context_20200911_204118-1aa27336.pth) | [log](https://openmmlab.oss-accelerate.aliyuncs.com/mmsegmentation/v0.5/deeplabv3/deeplabv3_r101-d8_480x480_80k_pascal_context/deeplabv3_r101-d8_480x480_40k_pascal_context-20200911_204118.log.json) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These filenames are not the same as the paths provided. Please check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be pascal_context-
not pascal_context_
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, check the timestamp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you means should be pascal_context_
not pascal_context-
I have fixed the model path mistakes. |
Task linked: CU-4fp4de Pascal Context |
* Add Pascal Context to mmsegmentation * Add benchmark result to Pascal Context * fix mmcv version * fix code syntax * fix code syntax again * Update mmseg/models/segmentors/encoder_decoder.py update hint Co-authored-by: Jerry Jiarui XU <[email protected]> * update comment * fix pascal context model path * fix model path mistake again * fix model path mistake again * fix model path mistakes again Co-authored-by: Jerry Jiarui XU <[email protected]>
* Update README.md line 23, 24 and 25: Remove "that" because "that" is unnecessary in these three sentences. line 33: Rewrite this sentence and make it more straightforward. line 34: This first sentence is incomplete. line 117: “focusses" -> "focuses" line 118: "continuous" -> "continuous" line 119: "consise" -> "concise" * Update README.md
No description provided.