Skip to content

Conversation

@ANAMASGARD
Copy link
Contributor

FIXES #147

Add two Mask R-CNN variants extending Faster R-CNN with mask prediction:

  • model_maskrcnn_resnet50_fpn
  • model_maskrcnn_resnet50_fpn_v2

Implementation details:

  • Mask prediction head with 4 conv layers and deconv upsampling
  • ROI Align for 14x14 feature extraction
  • Output 28x28 binary masks per detected object
  • Support for pretrained weight loading
  • Comprehensive test suite with 15 test cases
  • Full documentation with usage examples

Architecture:

  • Extends Faster R-CNN with parallel mask branch
  • Backbone: ResNet-50 with FPN
  • Mask head processes ROI features to generate segmentation masks
  • Class-specific masks with sigmoid activation

Output format includes boxes, labels, scores, and masks tensors.

Add two Mask R-CNN variants extending Faster R-CNN with mask prediction:
- model_maskrcnn_resnet50_fpn
- model_maskrcnn_resnet50_fpn_v2

Implementation details:
- Mask prediction head with 4 conv layers and deconv upsampling
- ROI Align for 14x14 feature extraction
- Output 28x28 binary masks per detected object
- Support for pretrained weight loading
- Comprehensive test suite with 15 test cases
- Full documentation with usage examples

Architecture:
- Extends Faster R-CNN with parallel mask branch
- Backbone: ResNet-50 with FPN
- Mask head processes ROI features to generate segmentation masks
- Class-specific masks with sigmoid activation

Output format includes boxes, labels, scores, and masks tensors.

FIXES mlverse#147
The implementation is correct. Tests were failing due to:
1. Incorrect nesting level in output structure validation
2. Platform-specific behavior of names() on nn_module objects
Add missing import directive for nn_conv_transpose2d and fix documentation line width to resolve R CMD check NOTEs.
Copy link
Collaborator

@cregouby cregouby left a comment

Choose a reason for hiding this comment

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

praise Thanks a lot for this clean addition !
todo few remarks inline

- Vectorize roi_align_masks coordinate calculations
- Add complete roxygen2 documentation with @nord
- Add MD5 hashes and file sizes for pretrained weights
- Enable MD5 validation for both model variants
@ANAMASGARD ANAMASGARD requested a review from cregouby January 6, 2026 16:49
@cregouby
Copy link
Collaborator

cregouby commented Jan 7, 2026

Thanks for the fix,
missing : could we add successful tests with the pretrained models ?
todo performance : this P.R. made CI duration increase from 40mins (which is already a issue) to 2h20mins. Is there a way to choose better defaults for the new tests to run timely ?

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.

[Instance segmentation model] Please implement Mask R-CNN model family

2 participants