Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Allow to specify the detection_threshold in the prediction method of ObjectDetector #954

Closed
Actis92 opened this issue Nov 12, 2021 · 2 comments · Fixed by #990
Closed

Allow to specify the detection_threshold in the prediction method of ObjectDetector #954

Actis92 opened this issue Nov 12, 2021 · 2 comments · Fixed by #990
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Actis92
Copy link
Contributor

Actis92 commented Nov 12, 2021

🚀 Feature

Allow in the method predict of the ObjectDetector to specify the parameter detection_threshold that is used to filter the bounding box in base of the confidence of the model

Motivation

In Icevision is possible to specify the detection_threshold that is used to filter the bounding box predicted by the model. If it's not specified the value is set to default at 0.5. Instead using ObjectDetector is not allow to specify this parameter and then the prediction are always filtered using the default threshold

Pitch

Allow to specify a custom value for the threshold used to filter the bounding boxes

Alternatives

Additional context

This is a screenshot of the predict method used in Icevision. If you agree that is can be useful to add this functionality I can work on it and open a PR
Schermata 2021-11-12 alle 12 58 43

@Actis92 Actis92 added enhancement New feature or request help wanted Extra attention is needed labels Nov 12, 2021
@ethanwharris
Copy link
Collaborator

ethanwharris commented Nov 22, 2021

Hi @Actis92 Yes I think this would be a very welcome addition! Here is the line that calls predict_from_dl, you could pass the additional kwarg there (which I think should be a property of the model set on init, maybe with a setter / getter in case people want to change it): https://github.com/PyTorchLightning/lightning-flash/blob/a0c97a39f2083b5344a08d248ccab7e5bfa91df4/flash/core/integrations/icevision/adapter.py#L201

I'll assign you to the issue. Let me know if you have any trouble implementing it 😃

@Actis92
Copy link
Contributor Author

Actis92 commented Nov 22, 2021

Hi @ethanwharris I have done the changes, I think in the same way as you have suggested. I have opened a pull request, so let me know if you think it's ok or must be done in a different way :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants