Skip to content

Fix post processing RF-DETR#46041

Merged
yonigozlan merged 8 commits into
huggingface:mainfrom
yonigozlan:fix-post-processing-rfdetr
May 19, 2026
Merged

Fix post processing RF-DETR#46041
yonigozlan merged 8 commits into
huggingface:mainfrom
yonigozlan:fix-post-processing-rfdetr

Conversation

@yonigozlan
Copy link
Copy Markdown
Member

What does this PR do?

The post processing used for RF-DETR was the same as the one for DETR, which is incorrect. We now use similar post-processing for both detection and segmentation as the original repo.
The preprocessing also introduced some differences with the original one as the original preprocessing rescale then resize, and we usually do the opposite in Transformers. We are now aligned with the original repo, and the remaining very small differences are due to differences in how we convert the images from pil to torch (pil_to_tensor then scale compared to to_tensor in the original repo), although this shouldn't affect the quality of the predictions.

Cc @molbap @SkalskiP

@yonigozlan yonigozlan requested a review from molbap May 18, 2026 22:18
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@yonigozlan
Copy link
Copy Markdown
Member Author

run-slow: rf_detr

@github-actions
Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

This comment contains run-slow, running the specified jobs:

models: ["models/rf_detr"]
quantizations: []

@github-actions
Copy link
Copy Markdown
Contributor

CI Results

Workflow Run ⚙️

Commit Info

Context Commit Description
RUN 02df063c workflow commit (merge commit)
PR 14dd7eb7 branch commit (from PR)
main 73d91596 base commit (on main)

✅ No failing test specific to this PR 🎉 👏 !

Copy link
Copy Markdown
Contributor

@molbap molbap left a comment

Choose a reason for hiding this comment

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

Thanks for fixing, let's make sure Expectations fall in reasonable deviations from original implem, then should be good. The new post processing seems in line with the rest of the DETR family. left two small comments

Comment thread src/transformers/models/rf_detr/modular_rf_detr.py
Comment thread src/transformers/models/rf_detr/modular_rf_detr.py
@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: auto, lw_detr, rf_detr

@yonigozlan
Copy link
Copy Markdown
Member Author

run-slow: rf_detr, lw_detr

@github-actions
Copy link
Copy Markdown
Contributor

Workflow Run ⚙️

This comment contains run-slow, running the specified jobs:

models: ["models/lw_detr", "models/rf_detr"]
quantizations: []

@yonigozlan yonigozlan enabled auto-merge May 19, 2026 16:53
@yonigozlan yonigozlan added this pull request to the merge queue May 19, 2026
@yonigozlan yonigozlan removed this pull request from the merge queue due to a manual request May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

CI Results

Workflow Run ⚙️

Commit Info

Context Commit Description
RUN c8038f4d workflow commit (merge commit)
PR 80832327 branch commit (from PR)
main b797f0d4 base commit (on main)

✅ No failing test specific to this PR 🎉 👏 !

@yonigozlan yonigozlan added this pull request to the merge queue May 19, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 19, 2026
@yonigozlan yonigozlan added this pull request to the merge queue May 19, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 19, 2026
@yonigozlan yonigozlan added this pull request to the merge queue May 19, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 19, 2026
@yonigozlan yonigozlan added this pull request to the merge queue May 19, 2026
Merged via the queue into huggingface:main with commit a0fb01c May 19, 2026
95 of 96 checks passed
@yonigozlan yonigozlan deleted the fix-post-processing-rfdetr branch May 19, 2026 18:32
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.

3 participants