Skip to content

Add threshold input to filter low-confidence detections#5

Open
jacoboromerodiaz wants to merge 1 commit into
schananas:mainfrom
jacoboromerodiaz:main
Open

Add threshold input to filter low-confidence detections#5
jacoboromerodiaz wants to merge 1 commit into
schananas:mainfrom
jacoboromerodiaz:main

Conversation

@jacoboromerodiaz

Copy link
Copy Markdown

While using this model I noticed it sometimes detects objects that aren't actually present in the image. These false detections still pass the current hardcoded box_threshold=0.3 in detect(), meaning the threshold alone isn't always tight enough.

This PR exposes box_threshold as a user-facing threshold input in the Replicate predictor, so callers can tune it without touching the code. The default stays at 0.3 to preserve existing behavior.

Changes:

  • Added threshold: float Input to predict.py (range 0.0–1.0, default 0.3)
  • Threaded it through run_grounding_sam, both detect() calls (positive and negative prompts.

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.

1 participant