question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PointRend: no 'pred_masks' field in instances when there are no predictions

See original GitHub issue

This commit changes behavior of PointRendMaskHead when there are no predictions on image. It does not add field pred_masks as before this commit. I expect this is not wanted behavior, as MaskRCNN also adds this field.

I think it’s because there’s no call mask_rcnn_inference now, when there are no predictions. before now

I can provide MWE if needed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ppwwyyxxcommented, Apr 27, 2021

It would be good to make sure all components work with empty inputs - they are so common in detection models. For the case in implicit pointrend, replacing 1x1 conv with a matmul will support empty size and also reads more clear to me:

import torch
from torch.nn import functional as F

num_instances = 0
C = 8
Cout = 16
num_points = 10

features = torch.rand(1, num_instances * C, num_points)
weights = torch.rand(num_instances * Cout, C, 1)
bias = torch.rand(num_instances * Cout)

out1 = F.conv1d(features, weights, bias, stride=1, padding=0,
        groups=num_instances) # fails for N=0

features = features.reshape(num_instances, C, num_points)
weights = weights.reshape(num_instances, Cout, C)
bias = bias.reshape(num_instances, Cout, 1)
out2 = torch.einsum("nck,ndc->ndk", features, weights) + bias

print(out2.shape)
print(torch.abs(out1.reshape(out2.shape)-out2).max())

I remember that I had a confusion earlier when reviewing the code using group conv

0reactions
ppwwyyxxcommented, May 7, 2021

Should be fixed by #2998

Read more comments on GitHub >

github_iconTop Results From Across the Web

PointRend Explained | Papers With Code
PointRend is a module for image segmentation tasks, such as instance and semantic ... PointRend makes predictions only on carefully selected points.
Read more >
PointRend: Image Segmentation As Rendering
Note how PointRend predicts masks with substantially finer detail around object boundaries. ... starting resolution of M0×M0, PointRend requires no more.
Read more >
PointRend: Image Segmentation as Rendering - arXiv
PointRend can be flexibly applied to both instance and semantic segmentation tasks by building on top of existing state-of-the-art models.
Read more >
DETECTRON2 PointRend Tutorial | Accurate Instance ...
Detectron2 tutorial for instance segmentation via PointRend. It projects the segmentation mask as ... There is no additional charge to you!
Read more >
Detectron2 - How to use Instance Image Segmentation for ...
This tutorial teaches you how to implement instance image segmentation with a real ... some or all images may show no predicted annotations....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found