transformers icon indicating copy to clipboard operation
transformers copied to clipboard

Fix post_process_semantic_segmentation removing valid class in Conditional DETR

Open vasanthrpjan1-boop opened this issue 1 month ago • 3 comments

Description: Fixes #42679 What does this PR do? Conditional DETR does not have a null class unlike DETR (its classifier outputs num_labels classes, not num_labels + 1). However, the post_process_semantic_segmentation method was incorrectly applying [..., :-1] to remove what it assumed was a null class, which actually removed the last valid class. This PR removes the incorrect slice in both: image_processing_conditional_detr.py image_processing_conditional_detr_fast.py

vasanthrpjan1-boop avatar Dec 07 '25 05:12 vasanthrpjan1-boop

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

run-slow: conditional_detr

github-actions[bot] avatar Dec 07 '25 05:12 github-actions[bot]

I'm mainly curious here why Conditional DETR has a post_process_semantic_segmentation method, cause the only pre-trained checkpoints shared are for object detection. Otherwise it looks good to me.

NielsRogge avatar Dec 09 '25 11:12 NielsRogge

yes I also checked in the docs we only have randomly initialized model + in the paper there's none either, maybe it's for random head initialization with a backbone

merveenoyan avatar Dec 09 '25 14:12 merveenoyan