-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
CodeCamp #151[Feature] Support HieraSeg on cityscapes #2444
CodeCamp #151[Feature] Support HieraSeg on cityscapes #2444
Conversation
CodeCamp #144 [Doc] Chinese version of config tutorial
Co-authored-by: 谢昕辰 <[email protected]>
CodeCamp #147 [Doc] Add Chinese version of train & test tutorial
Co-authored-by: 谢昕辰 <[email protected]>
Co-authored-by: 谢昕辰 <[email protected]>
CodeCamp #1562 [Doc] Add Chinese version of `overview.md`
[CI] Add torch1.13 checking in CI
[Doc] Add ZN datasets.md in dev-1.x
…/mmsegmentation into AI-Tianlong/Support_HieraSeg
projects/HieraSeg_project/configs/_base_/models/deeplabv3plus_r50-d8_vd_contrast.py
Outdated
Show resolved
Hide resolved
...aSeg_project/configs/hieraseg/deeplabv3plus_r101-d8_512x1024_80k_cityscapes_hiera_triplet.py
Outdated
Show resolved
Hide resolved
import torch.nn.functional as F | ||
|
||
|
||
class TreeTripletLoss(nn.Module): |
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.
Might also add to register and support customizing parameters
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.
Might add docstring.
super().__init__() | ||
self.num_classes = num_classes | ||
self.loss_weight = loss_weight | ||
self.treetripletloss = TreeTripletLoss(19, hiera_map, hiera_index) |
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.
Might support customizing.
MCMA = predictions[:, :num_classes, :, :] | ||
MCMB_back = torch.max( | ||
torch.cat([ | ||
predictions[:, 0:1, :, :], | ||
predictions[:, num_classes:num_classes + 1, :, :] | ||
], | ||
dim=1), 1, True)[0] | ||
MCMB1 = torch.max( |
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.
Might add some comments to explain what MCMA
, MCMB
, and others mean.
projects/HieraSeg_project/decode_head/sep_aspp_contrast_head.py
Outdated
Show resolved
Hide resolved
feats_pos = feats[index_pos][:min_size] | ||
feats_neg = feats[index_neg][:min_size] | ||
|
||
distance = torch.zeros(min_size, 2).cuda() |
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.
the device of model training might be not cuda.
distance = torch.zeros(min_size, 2).cuda() | |
distance = torch.zeros(min_size, 2).to(feats) |
## Motivation Supplementary PR #2444 Fix tiny bug and add loss_by_feat() to compute loss to train. The inference process have verified to be accurate. ## Modification - modify `sep_aspp_contrast_head.py` , add `loss_by_feat()` function to train(training still has bug, will fix in future😫) - fix testing commands path error `bash tools/dist_test.sh projects/HieraSeg_project/` to `bash tools/dist_test.sh projects/HieraSeg/` at README.md
…-mmlab#2444) ## Support `HieraSeg` interface on `cityscapes` ## Motivation Support `HieraSeg` interface on cityscapes dataset Paper link : https://ieeexplore.ieee.org/document/9878466/ ``` @Article{li2022deep, title={Deep Hierarchical Semantic Segmentation}, author={Li, Liulei and Zhou, Tianfei and Wang, Wenguan and Li, Jianwu and Yang, Yi}, journal={CVPR}, year={2022} } ``` ## Modification Add `HieraSeg_Projects` on `projects/` Add `sep_aspp_contrast_head` decoder head. Add `HieraSeg` config. Add `hiera_loss`, `hiera_triplet_loss_cityscape`, `tree_triplet_loss`
open-mmlab#2565) ## Motivation Supplementary PR open-mmlab#2444 Fix tiny bug and add loss_by_feat() to compute loss to train. The inference process have verified to be accurate. ## Modification - modify `sep_aspp_contrast_head.py` , add `loss_by_feat()` function to train(training still has bug, will fix in future😫) - fix testing commands path error `bash tools/dist_test.sh projects/HieraSeg_project/` to `bash tools/dist_test.sh projects/HieraSeg/` at README.md
Support
HieraSeg
interface oncityscapes
Motivation
Support
HieraSeg
interface on cityscapes datasetPaper link : https://ieeexplore.ieee.org/document/9878466/
Modification
Add
HieraSeg_Projects
onprojects/
Add
sep_aspp_contrast_head
decoder head.Add
HieraSeg
config.Add
hiera_loss
,hiera_triplet_loss_cityscape
,tree_triplet_loss
Checklist