[Enhancement] Support dynamic threshold range in eval_hmean #962
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
The current implementation of
eval_hmean
only provides a parameter to set the minimum score with which the boundaries are used for evaluation. However, it always evaluates the filtered boundaries on a fixed set of threshold values[0.3, 0,4, ..., 0.9]
no matter what the minimum score is, which is an inflexible and illogical design. There is also no entry in the config to customize such a behavior.Modification
This PR replaces
score_thr
withmin_score_thr, max_score_thr, step
so that users can configure the search space via input parameters.IcdarDataset.evaluate()
is modified to allow these three parameters to be customized through the config file.For example, by adapting the following snippet in the config, one can evaluate the model's output on a list of boundary score thresholds
[0.1, 0.2, 0.3, 0.4, 0.5]
and get the best score from them.BC-breaking (Optional)
None