Weird behaviour with instance segmentation
See original GitHub issueHello, I’m trying to use Detr for instance segmentation and trained following the guidelines:
- Train Box-Model 2. train with
--masks
without any coco_panoptic flags. The training curve for my segm mAP looks good, however, i noticed that the mask spans all instances for every valid prediction instead of the expected one mask per instance. Boxes work fine though.
out = model(img)
probas = out['pred_logits'].softmax(-1)[0, :, :-1]
keep = probas.max(-1).values > 0.5
ncols = 2
fig, axs = plt.subplots(ncols=ncols, nrows=math.ceil(keep.sum().item() / ncols), figsize=(18, 10))
for line in axs:
for a in line:
a.axis('off')
for i, mask in enumerate(out["pred_masks"][keep]):
ax = axs[i // ncols, i % ncols]
ax.imshow(mask, cmap="cividis")
ax.axis('off')
- Target masks in each image are separated (e.g. 4 individual masks for each instance) in train/valid dataloader
- Not a (big) issue using the out-of-the-box panoptic model (although obviously poor results due to lack of fine tuning):
model, postprocessor = torch.hub.load('facebookresearch/detr', 'detr_resnet101_panoptic', pretrained=True, return_postprocessor=True, num_classes=250)
So what could be the cause of this problem?
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Thermal Imaging-Based Instance Segmentation for Automated ...
The report will investigate the usage of Instance Segmentation ... However, it quickly led to weird behaviour in the training, where.
Read more >Is segmentation fault actual undefined behavior when we refer ...
Undefined behavior means that anything can happen with a standard conforming implementation. Really anything. (and your point 2 is UB).
Read more >Multi-instance Object Segmentation with Occlusion Handling
We present a multi-instance object segmentation algo- rithm to tackle occlusions. As an object is split into two parts by an occluder, ...
Read more >What Is Instance Segmentation? [2022 Guide & Tutorial]
Instance segmentation is the task of detecting and segmenting objects in images. See different approaches to instance segmentation, including Mask R-CNN.
Read more >INSTR: Unknown Object Segmentation from Stereo Images
This is the IROS2021 presentation of our recent work "Unknown Object Segmentation from Stereo Images" by M. Durner, W. Boerdijk, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Training both bbox&segm straight on the pretrained panoptic weights with only class weights removed and nothing frozen was the solution. Got box mAP 0.65 & segm mAP 0.60 right now. Thank you for your help.
Hi @m-klasen
what do you exactly mean with point #1?
I delete class embed weights and biases before fine tuning.
The output of this operation becomes the
--resume
input.