Skip to content

Check target boxes input on generalized_rcnn.py #2207

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

Merged
merged 3 commits into from
May 14, 2020
Merged

Check target boxes input on generalized_rcnn.py #2207

merged 3 commits into from
May 14, 2020

Conversation

mmcenta
Copy link
Contributor

@mmcenta mmcenta commented May 12, 2020

Solves #2192 with minimal changes, but I can add checks to the labels and scores fields too. I would also like your opinion on creating a function to make these checks because they can get quite verbose (especially if we check the other fields as well).

Additionally, if we want full validation of the model-specific fields (e.g. masks for Mask R-CNN) we need to specify a check function for each child, perhaps by overriding a _check method or passing it to the __init__ method.

Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR!

I've left a comment, let me know what you think.

About making a function, I would be ok with it, but that can be left for a follow-up PR. You'll also need to add type annotations to it, so that torchscript knows how to handle it.

Also, could you add some tests? Maybe in test/test_models.py or a different test file there, like test/test_models_detection_utlls.py.

@mmcenta
Copy link
Contributor Author

mmcenta commented May 13, 2020

I fixed the issue and added tests in test/models.py. I chose not to create a new file just yet.
If we choose to expand validation, I can work on the functions and then create separate tests for them.

@mmcenta mmcenta requested a review from fmassa May 14, 2020 13:37
Copy link
Member

@fmassa fmassa left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants