-
Notifications
You must be signed in to change notification settings - Fork 433
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 mmsegmentation DeepLabv3(+) #684
Conversation
I like the thought but is this necessary right now? does mmseg support something like this or are the urls aliased?
Agreed, I'm thinking directories can specify whole model families sort of like our resnets. We should discuss this elsewhere
all the openmm lab stuff is more actively developed. additionally, it looks like mmseg/mmdet are supersets of detectron with similar api's so if we're going to pick one i think mmseg is a good bet. |
As of now, we are only using the heads from mmsegmentation, but still using torchvision backbones. The url argument functionality is to specify a specific torchvision url weight i.e. swap between weights from the old and new torchvision training recipes. This isn't necessary, but I foresee running experiments that swap between different pretrained weights. |
@A-Jacobson Updated numbers in first table based off of recent runs. DeepLabv3 looks really good while DeepLabv3+ may be falling a bit short. One seed reaches the target mIoU the epoch before, not sure if that is sufficient 😬 |
I'm good with this as the baseline wasn't significantly different! |
try: | ||
from mmseg.models import ASPPHead, DepthwiseSeparableASPPHead # type: ignore | ||
except ImportError as e: | ||
raise ImportError( | ||
textwrap.dedent("""\ | ||
Either mmcv or mmsegmentation is not installed. To install mmcv, please run pip install mmcv-full==1.4.4 -f | ||
https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html where {cu_version} and | ||
{torch_version} refer to your CUDA and PyTorch versions, respectively. To install mmsegmentation, please | ||
run pip install mmsegmentation==0.22.0 on command-line.""")) from e |
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.
@ravi-mosaicml just double checking... Does this good to you?
As you quoted detectron, do you have any quick solution to easily integrate this in detectron2 and possibly speed up training ? |
Hi @ExtReMLapin! Thanks for checking out composer. We don't yet have any convenience wrappers for detectron2 like we do for timm, but you could still train a detectron model using composer methods. I can see two ways to accomplish this right now.
Regarding which methods to use, SAM and SWA are likely to play nicely with detection/instance segmentation. Augmentation based methods and mixup style methods likely wont. Yet. |
Thank you for your answer, i'll give a try as soon as I'm confident enough with all the pytorch/detectron2 ecosystem |
Motivation
We were using torchvision's DeepLabv3 model for segmentation results, but most papers use DeepLabv3+ as a baseline for semantic segmentation tasks.
Implementation
This PR uses the DeepLabv3+ model from mmsegmentation which is a commonly used segmentation library (used in at least ConvNext, Swin, and SegFormer). One caveat is that mmsegmentation makes adjustments to the original DeepLabv3(+) model, but maybe this can be justified since ADE20k should be more difficult than the datasets DeepLabv3 was originally proposed for.
Instead of completely removing DeepLabv3, I've added a flag to toggle between the two implementations in mmsegmentation.
Somewhat unrelated, I added an argument to specify the url to download the backbone weights from to make some future experiments easier.
Side notes:
Results
mmsegmentation one-run results: 45 mIoU and 45.47 mIoU for DeepLabv3 and DeepLabv3+, respectively. There are several differences that make it difficult to compare our numbers to theirs: