Skip to content
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

Rewrite test and fix masks_to_boxes implementation #4469

Merged
merged 5 commits into from
Sep 24, 2021

Conversation

oke-aditya
Copy link
Contributor

Fix the comments suggested in #4290 (comment)

Copy link
Contributor Author

@oke-aditya oke-aditya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments for rewiew

test/test_ops.py Outdated

for dtype in [torch.int16, torch.int32, torch.int64]:
masks = torch.zeros((image.n_frames, image.height, image.width), dtype=dtype)
masks = _create_masks(image, masks)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One we know to create masks better way, without the image we can fix this,

torchvision/ops/boxes.py Show resolved Hide resolved
Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oke-aditya Thanks for the PR. LGTM.

On the future, we could potentially do a couple of iterations to improve the tests of this operator. We should also look into the fact that the gallery uses an asset from tests, which is not great.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @oke-aditya , some minor comments but LGTM

I agree with @datumbox 's box comment about not relying on the test directory in the galleries

test/test_ops.py Show resolved Hide resolved
test/test_ops.py Show resolved Hide resolved
torchvision/ops/boxes.py Show resolved Hide resolved
test/test_ops.py Show resolved Hide resolved
@oke-aditya oke-aditya requested a review from datumbox September 23, 2021 16:05
test/test_ops.py Outdated Show resolved Hide resolved
@oke-aditya
Copy link
Contributor Author

I think I should have addressed all the issues 😄 Thanks for the detailed review

Copy link
Contributor

@datumbox datumbox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, still. :)

I think the PR is a net positive and since it fixes the device bug, we should merge it. Happy to review follow up PRs that further improve the tests of the operator.

@oke-aditya
Copy link
Contributor Author

oke-aditya commented Sep 23, 2021

I think I will followup to make gallery example a bit more robust. Also see if we can do with a PNG image and PNG mask (like in PenFudan) instead of a tiff.
Also try to use our plotting utilities to do the plotting job.

And a small demonstration to convert a segmentation dataset to detection.

@NicolasHug NicolasHug merged commit cdb6fba into pytorch:main Sep 24, 2021
@NicolasHug
Copy link
Member

Thanks @oke-aditya ! Looking forward to the follow-ups.

@datumbox should we remove the "bug" label for this PR and just use the same labels as for #4290?

If we keep "bug" there's a high change this will end up as an entry in the bugfix section in the changlog, and this won't be accurate since this is something that hadn't been released yet.

@oke-aditya oke-aditya deleted the fix_mbox branch September 24, 2021 07:37
@datumbox
Copy link
Contributor

datumbox commented Sep 24, 2021

@NicolasHug Hmm... TLDR: Sure thing, go ahead.

The slightly longer response is that the label is accurate in a sense that this PR fixes a bug. I do agree with you that it shouldn't be reported on the changelog as we are not fixing a bug of the previous release. So I think there might be an issue with how we use the tags as there are conflicting needs for example release notes require tagging fixes on old things as bug, while tracking better engineering initiatives requires tagging all. I think that's a good topic for DAPI or Vision weekly as we are going to bump on it again and again.

@NicolasHug
Copy link
Member

I'll remove it for this one, but I agree this is something we could discuss and improve

facebook-github-bot pushed a commit that referenced this pull request Sep 30, 2021
Summary: Co-authored-by: Nicolas Hug <[email protected]>

Reviewed By: datumbox

Differential Revision: D31268032

fbshipit-source-id: 61fe5ca1d28071d9683da519ea4f79a0bc417f48
husthyc added a commit that referenced this pull request Oct 22, 2021
Co-authored-by: Nicolas Hug <[email protected]>

[ghstack-poisoned]
cyyever pushed a commit to cyyever/vision that referenced this pull request Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants