huggingface.js
huggingface.js copied to clipboard
Add threshold parameter for object detection widget
Is your feature request related to a problem? Please describe.
Currently, the object detection widgets don't have a threshold parameter, so they just use the hardcoded one from the object detection pipeline, which is 0.9 as seen here.
However, with more and more object detection models coming, we definitely need an adjustable threshold button for the widget, as for instance now Deformable DETR checkpoints, which need a lower threshold to detect objects in a scene, simply say "no objects detected":
Describe the solution you'd like Adding a "threshold button" to the inference widgets. Perhaps make it possible to set a default threshold in the model card.
Is this supported in the pipeline class already @NielsRogge ?
Hey @osanseviero, threshold is already supported in the pipeline class, I'm updating the pipeline to use the post_process_object_detection methods instead of post_process with this PR. We still need to add a threshold slider to the inference widgets though.
Cc @mishig25 and @OlivierDehaene maybe can help here (adding the slider in the widget and adding support in the inference API for this)
I think this is a critical feature.
cc @mishig25 would you be up for implementing this?