Skip to content

[Fix] fix np.arange() output not stable error #1749

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

Open
wants to merge 4 commits into
base: dev-1.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion mmocr/evaluation/metrics/hmean_iou_metric.py
Original file line number Diff line number Diff line change
@@ -70,7 +70,13 @@ def __init__(self,
super().__init__(collect_device=collect_device, prefix=prefix)
self.match_iou_thr = match_iou_thr
self.ignore_precision_thr = ignore_precision_thr
self.pred_score_thrs = np.arange(**pred_score_thrs)
self.pred_score_thrs = np.linspace(
pred_score_thrs['start'],
pred_score_thrs['stop'],
int(
np.round((pred_score_thrs['stop'] - pred_score_thrs['start']) /
pred_score_thrs['step'])) + 1,
endpoint=True)
assert strategy in ['max_matching', 'vanilla']
self.strategy = strategy

8 changes: 7 additions & 1 deletion projects/ABCNet/abcnet/metric/e2e_hmean_iou_metric.py
Original file line number Diff line number Diff line change
@@ -75,7 +75,13 @@ def __init__(self,
super().__init__(collect_device=collect_device, prefix=prefix)
self.match_iou_thr = match_iou_thr
self.ignore_precision_thr = ignore_precision_thr
self.pred_score_thrs = np.arange(**pred_score_thrs)
self.pred_score_thrs = np.linspace(
pred_score_thrs['start'],
pred_score_thrs['stop'],
int(
np.round((pred_score_thrs['stop'] - pred_score_thrs['start']) /
pred_score_thrs['step'])) + 1,
endpoint=True)
self.word_spotting = word_spotting
self.min_length_case_word = min_length_case_word
self.special_characters = special_characters
8 changes: 7 additions & 1 deletion projects/SPTS/spts/metric/e2e_point_metric.py
Original file line number Diff line number Diff line change
@@ -58,7 +58,13 @@ def __init__(self,
collect_device: str = 'cpu',
prefix: Optional[str] = None) -> None:
super().__init__(collect_device=collect_device, prefix=prefix)
self.text_score_thrs = np.arange(**text_score_thrs)
self.text_score_thrs = np.linspace(
text_score_thrs['start'],
text_score_thrs['stop'],
int(
np.round((text_score_thrs['stop'] - text_score_thrs['start']) /
text_score_thrs['step'])) + 1,
endpoint=True)
self.word_spotting = word_spotting
self.match_dist_thr = match_dist_thr
if lexicon_path: