Skip to content

Conversation

@ANAMASGARD
Copy link
Contributor

@ANAMASGARD ANAMASGARD commented Nov 21, 2025

Add comprehensive test suite for ConvNeXt object detection models before implementation .

Tests cover:

  • All 3 variants: tiny/small/base
  • Pretrained backbone support
  • Multi-scale inputs (224-512px)
  • Parameter validation
  • FPN feature extraction
  • Faster R-CNN API compatibility

Status: Tests fail as expected (no implementation yet)

In the upcoming commits I will add the actual implementation.

FIXES #256

@cregouby
Copy link
Collaborator

cregouby commented Dec 3, 2025

Hello @ANAMASGARD,

Thanks for this contribution !
Looking forward for the underlying code !

Implements ConvNeXt-based object detection heads using the existing Faster R-CNN
pipeline (RPN + ROI heads) with ConvNeXt+FPN backbones.

- Adds tiny/small/base ConvNeXt FPN backbones
- Exposes model_convnext_tiny_detection(), _small_detection(), _base_detection()
- Keeps output format compatible with existing Faster R-CNN models
- Makes all ConvNeXt detection tests pass (TDD Phase 2)

Refs mlverse#256
@ANAMASGARD
Copy link
Contributor Author

@cregouby Can you please approve and review my PR and give your feedback !
Thank You .

@cregouby
Copy link
Collaborator

cregouby commented Dec 3, 2025

Sure, I will. Just give me some time....

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 really nice contribution!
suggestion : would you add your person() as contributor ctb in the DESCRIPTION file ?
todo add an example and switch to conditions.R functions for messages (see inline)

@ANAMASGARD
Copy link
Contributor Author

Sir @cregouby can you please re initialize the workflow so that we can see if there errors there,
also please tell me if I can help in any other way , Thanks .

@ANAMASGARD
Copy link
Contributor Author

Sir @cregouby can you please give feedback on how can these failing test cases be passed.

@cregouby
Copy link
Collaborator

cregouby commented Dec 5, 2025

Hello @ANAMASGARD,

Have you tried to run the just-added example ?
I feel there is a $topk() missing to select the best bounding-box out of the model prediction. Trying topk with k=5 on my laptop, I get inconsistant bounding-boxes (with y_max < y_min ):

> topk <- pred$scores$topk(k = 5)[[2]]
> boxes <- pred$boxes[topk, ]
> boxes
torch_tensor
-0.1104  2.7817  1.3124 -4.0643
-0.2005  2.7428  1.7754 -4.1288
 0.7580  3.2098 -1.7157  0.5556
 0.2230  3.1610  1.3431 -3.9176
-0.0881  2.8218  0.9908 -3.9863
[ CPUFloatType{5,4} ][ grad_fn = <SliceBackward0> ]

Plus looking at the normalized image, I doubt the transform_normalize() parameter are correct :
image

@cregouby
Copy link
Collaborator

cregouby commented Dec 5, 2025

praise Thanks for the clarification.
reorder :But we should explicit that upfront, close to the pretrained_backbone parameter, not at the end of the example.
Suggestion: I definitivelly prefer an example applied on real image (i.e. your previous one)

upvote the note on random bboxes
restore test on error message
bypass lfw test on windows runner
@cregouby cregouby merged commit e3b1522 into mlverse:main Dec 6, 2025
3 checks passed
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.

[Object Detection model] Please implement convnext detection head

2 participants