-
Notifications
You must be signed in to change notification settings - Fork 626
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
Exclude classes from inference using pretrained or custom models #1104
base: main
Are you sure you want to change the base?
Conversation
…ls on SAHI - Pull request 1. This feature allows to perform 'predict', 'get_sliced_prediction', and 'get_prediction' inserting a new custom parameter. An example is provided in the code 'test_exclude_classes.py'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only one thing missing is adding these new parameters into the methods definitions (the comments explaining the parameters, and not adding it to the method as parameter, which has been already done), it is not such a huge issue to deal with. Waiting for your review and approval.
I updated the code and workflow also using both black and isort. Waiting for your approval. |
I removed the test on exclude classes cause it was inserting conflicts on the tests levels. I am waiting for your approval |
Hi @fcakyon, If there is any other feature or things I can do to enhance the project, please let me know or contact me privately, if necessary. Thanks. |
Thanks for the work @gguzzy ! We can work to merge your PR after this project refactor PR 👍🏻 |
Hello dear all,
I am writing you to share and open a PR to include in your framework the option to exclude certain classes from inferences/predictions performed, since I found this useful in general.
This allows us to exclude predictions which are not considered by a custom user.
This can be done by using two new optional parameters which are: exclude_classes_names and exclude_classes_id.
Recall to use the same notation for class names and ids accordingly to the loaded model.
I introduced an example which shows the usage of the new parameter, added to folder tests as test_exclude_classes.py'
The methods which include the new parameters are the ones which are responsible for predictions, which are 'prediction, get_sliced_prediction, get_prediction' and their respective usages inside the 'predict.py' class.