Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Object detection pipeline] Lower threshold #30710

Conversation

NielsRogge
Copy link
Contributor

What does this PR do?

This PR proposes to lower the default threshold of the object detection pipeline. It is currently set to 0.9, which causes a lot of inference widgets to not show any detected objects.

@NielsRogge NielsRogge requested a review from qubvel May 8, 2024 12:38
Copy link
Collaborator

@amyeroberts amyeroberts 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 updating!

Agreed, it's not BC but this seems like a better value

@HuggingFaceDocBuilderDev

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.

@SangbumChoi
Copy link
Contributor

SangbumChoi commented May 10, 2024

FYI, we usually use much more lower score threshold (e.g. 0.3) to see just tendency of the model. (+ Note that transformers has transformer architecture which have lower confidence level)

facebookresearch/detr#216

https://github.com/IDEA-Research/DINO/blob/main/inference_and_visualization.ipynb

@qubvel
Copy link
Member

qubvel commented May 13, 2024

@NielsRogge should we merge it, or do you have something to add?

@NielsRogge
Copy link
Contributor Author

I haven't tried the pipeline yet with various thresholds. Do you think we should lower it even more? It could result in too many detections. Wondering what the best default value is

@amyeroberts
Copy link
Collaborator

@NielsRogge We can always lower it further if necessary. I'd merge as-is and based on observations / feedback we can always update.

@qubvel
Copy link
Member

qubvel commented May 13, 2024

With my experiments on cppe-5 dataset threshold=0.4..0.5 visually looks fine, otherwise, too many FP appear.

With a quick search in other frameworks, I found for some models:

  • In Utlralitics - 0.25 / 0.3
  • In Mmedection - 0.05 / 0.3 / 0.5

But in general, it depends on the model and dataset

@NielsRogge
Copy link
Contributor Author

Ok thanks, will merge in that case.

@NielsRogge NielsRogge merged commit ce87dca into huggingface:main May 13, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

6 participants