Skip to content

Conversation

@deruyter92
Copy link
Collaborator

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_runners in deeplabcut.pose_estimation_pytorch now accepts an optional argument min_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).

tlancaster6 and others added 6 commits October 9, 2025 11:08
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.
@deruyter92 deruyter92 marked this pull request as ready for review December 4, 2025 10:51
@tlancaster6
Copy link

Thank you for picking up my PR and running with it, your edits all look good to me!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 RemoveLowConfidenceBoxes postprocessor class to filter bounding boxes based on score threshold
  • Added min_bbox_score parameter to get_inference_runners, get_detector_inference_runner, and get_filtered_coco_detector_inference_runner functions
  • Updated build_detector_postprocessor to 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.

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.

2 participants