Skip to content

Fix models faster_rcnn_ and mask_rcnn_ architecture#318

Merged
cregouby merged 13 commits intomainfrom
bugfix/faster_rcnn_architecture
Apr 18, 2026
Merged

Fix models faster_rcnn_ and mask_rcnn_ architecture#318
cregouby merged 13 commits intomainfrom
bugfix/faster_rcnn_architecture

Conversation

@cregouby
Copy link
Copy Markdown
Collaborator

@cregouby cregouby commented Apr 18, 2026

  • Update coco_classes() to the sparse 90 classes list to match model predictions.
  • fix RPN Head and Box head architecure for model_mask_rcnn_*
  • fix Level Anchor generator and mask decoding, and gather post-process detection into a function for model_faster_rcnn_*
  • ensure accelerator compatibility to model_faster_rcnn_*
  • include the expected class in pretrained model inference tests

Fix #316

For MobileNet (15 anchors): Uses 5 base sizes × 3 aspect ratios [0.5, 1.0, 2.0]
For ResNet (3 anchors): Uses single stride-scaled base size × aspect ratios [0.5, 1.0, 2.0]
Converts anchors using box_cxcywh_to_xyxy()
ensure MPS compatibility
fix typo and remove non-default parameters in tests
Updated `fasterrcnn_model$forward()` to use postprocessing
Updated `fasterrcnn_model_v2$forward()` to use postprocessing
Updated `fasterrcnn_mobilenet_model$forward()` to use postprocessing
Updated `maskrcnn_model$forward()` to use  postprocessing
Updated `maskrcnn_model_v2$forward()` to use  postprocessing
Simplified mask prediction logic (uses decoded boxes directly)
Add bbox regression weights and clamp bbox deltas
@cregouby cregouby merged commit d57a89f into main Apr 18, 2026
3 checks passed
@cregouby cregouby deleted the bugfix/faster_rcnn_architecture branch April 18, 2026 16:23
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.

model_fasterrcnn_* and model_maskrcnn_* provides poor detection results

2 participants