feat: Filter out low-confidence bounding box detections#3154
Merged
MMathisLab merged 10 commits intoDeepLabCut:mainfrom Jan 13, 2026
Merged
feat: Filter out low-confidence bounding box detections#3154MMathisLab merged 10 commits intoDeepLabCut:mainfrom
MMathisLab merged 10 commits intoDeepLabCut:mainfrom
Conversation
fixes issue with len(keepers). Since keepers is a tuple with indices, it's len() is not indicative of the number of bboxes that should be kept. This is resolved by using Any()
… reproducibility. instead of a default filtering threshold of 0.25, the filtering is made optional and by default all bboxes are kept.
Low-confidence bounding boxes are removed when min_bbox_score parameter is provided. Default behavior remains unchanged.
Closed
Contributor
|
Thank you for picking up my PR and running with it, your edits all look good to me! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds functionality to filter out low-confidence bounding box detections during top-down pose estimation. The feature helps reduce false positives by removing detections below a configurable confidence threshold.
Key changes:
- Added a new
RemoveLowConfidenceBoxespostprocessor class to filter bounding boxes based on score threshold - Added
min_bbox_scoreparameter toget_inference_runners,get_detector_inference_runner, andget_filtered_coco_detector_inference_runnerfunctions - Updated
build_detector_postprocessorto optionally apply the low-confidence box filtering
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| deeplabcut/pose_estimation_pytorch/data/postprocessor.py | Added RemoveLowConfidenceBoxes class and updated build_detector_postprocessor to accept min_bbox_score parameter for filtering low-confidence detections |
| deeplabcut/pose_estimation_pytorch/apis/utils.py | Added min_bbox_score parameter to three inference runner functions (get_inference_runners, get_detector_inference_runner, get_filtered_coco_detector_inference_runner) with appropriate documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… quotes and logging instead of print.
(should be interpreted as the *minimum acceptible confidence)
MMathisLab
approved these changes
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Revised version of PR #3118 by @tlancaster6
Feature
Filter out low-confidence bounding box detections during top-down pose estimation to reduce false-positives.
Function
get_inference_runnersin deeplabcut.pose_estimation_pytorch now accepts an optional argumentmin_bbox_score. Low-confidence bounding boxes are removed when min_bbox_score parameter is provided. Default behavior remains unchanged (i.e. all bounding boxes are kept).