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

Update channels_first parameter and docstring for PyTorch Object Detectors #2265

Merged
merged 3 commits into from
Sep 12, 2023

Conversation

f4str
Copy link
Collaborator

@f4str f4str commented Aug 30, 2023

Description

Set the channels_first parameter in PyTorchObjectDetector and PyTorchFasterRCNN to default to true instead of false and update the input_shape default parameter accordingly.

Additionally, update docstrings and the type hinting for PyTorchFasterRCNN.

Fixes #2264

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.

  • Test cases for PyTorchObjectDetector are unchanged
  • Test cases for PyTorchFasterRCNN are unchanged
  • Test cases for PyTorchYolo are unchanged

Test Configuration:

  • OS
  • Python version
  • ART version or commit number
  • TensorFlow / Keras / PyTorch / MXNet version

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
@f4str f4str changed the base branch from main to dev_1.15.2 August 30, 2023 22:18
@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2023

Codecov Report

Merging #2265 (98016c6) into dev_1.15.2 (ad0a546) will increase coverage by 3.98%.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Impacted file tree graph

@@              Coverage Diff               @@
##           dev_1.15.2    #2265      +/-   ##
==============================================
+ Coverage       81.63%   85.61%   +3.98%     
==============================================
  Files             308      308              
  Lines           27476    27476              
  Branches         5048     5048              
==============================================
+ Hits            22429    23523    +1094     
+ Misses           3817     2671    -1146     
- Partials         1230     1282      +52     
Files Changed Coverage Δ
...estimators/object_detection/pytorch_faster_rcnn.py 100.00% <ø> (ø)
...mators/object_detection/pytorch_object_detector.py 84.65% <ø> (ø)
art/estimators/object_detection/pytorch_yolo.py 82.48% <ø> (ø)

... and 30 files with indirect coverage changes

📢 Have feedback on the report? Share it here.

@beat-buesser beat-buesser self-requested a review September 1, 2023 10:58
@beat-buesser beat-buesser self-assigned this Sep 1, 2023
@beat-buesser beat-buesser added bug Something isn't working improvement Improve implementation labels Sep 1, 2023
@beat-buesser beat-buesser added this to the ART 1.15.2 milestone Sep 1, 2023
model: Optional["torchvision.models.detection.fasterrcnn_resnet50_fpn"] = None,
input_shape: Tuple[int, ...] = (-1, -1, -1),
model: Optional["torchvision.models.detection.FasterRCNN"] = None,
input_shape: Tuple[int, ...] = (3, 416, 416),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the Faster R-CNN model of torchvision expect this input size?

Copy link
Collaborator

@beat-buesser beat-buesser left a comment

Choose a reason for hiding this comment

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

Hi @f4str Thank you very much for the pull request! I have one question about the input shape, what do you think?

Signed-off-by: Farhan Ahmed <Farhan.Ahmed@ibm.com>
@f4str f4str force-pushed the pt-object-detector-param branch from 11b5511 to 98016c6 Compare September 5, 2023 19:41
@f4str f4str requested a review from beat-buesser September 5, 2023 19:42
@f4str
Copy link
Collaborator Author

f4str commented Sep 5, 2023

Hi @beat-buesser thank you for the review. As per our discussion, it does make sense to leave the input_shape parameter for the PyTorchObjectDetector and PyTorchFasterRCNN as (-1, -1, -1) since they accept any input arbitrarily sized image. I've made the corresponding change.

@beat-buesser beat-buesser merged commit e84835f into Trusted-AI:dev_1.15.2 Sep 12, 2023
@f4str f4str deleted the pt-object-detector-param branch September 12, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working improvement Improve implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change the channels_first parameter in PyTorchObjectDetector and PyTorchFasterRCNN to True
3 participants