Skip to content

Commit

Permalink
[Test] Fix release task problem (#520)
Browse files Browse the repository at this point in the history
* Fix release task

* Update compare_with_gt.py

* fix code style
  • Loading branch information
jiangjiajun committed Nov 8, 2022
1 parent b0af754 commit c7277ef
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions tests/release_task/compare_with_gt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,46 @@

diff_score_threshold = {
"linux-x64": {
"label_diff": 0,
"label_diff": 1e-02,
"score_diff": 1e-4,
"boxes_diff_ratio": 1e-4,
"boxes_diff": 1e-3
},
"linux-aarch64": {
"label_diff": 0,
"label_diff": 1e-02,
"score_diff": 1e-4,
"boxes_diff_ratio": 1e-4,
"boxes_diff": 1e-3
},
"osx-x86_64": {
"label_diff": 0,
"label_diff": 1e-02,
"score_diff": 1e-4,
"boxes_diff_ratio": 2e-4,
"boxes_diff": 1e-3
},
"osx-arm64": {
"label_diff": 0,
"label_diff": 1e-02,
"score_diff": 1e-4,
"boxes_diff_ratio": 2e-4,
"boxes_diff": 1e-3
},
"win-x64": {
"label_diff": 0,
"label_diff": 1e-02,
"score_diff": 5e-4,
"boxes_diff_ratio": 1e-3,
"boxes_diff": 1e-3
}
}


def all_sort(x):
x1 = x.T
y = np.split(x1, len(x1))
z = list(reversed(y))
index = np.lexsort(z)
return x[index]


def parse_arguments():
import argparse
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -83,8 +91,8 @@ def write2file(error_file):
with open(error_file, "a+") as f:
from platform import python_version
py_version = python_version()
f.write(args.platform + " " + py_version + " " +
args.result_path.split(".")[0] + "\n")
f.write(args.platform + " " + py_version + " " + args.result_path.split(
".")[0] + "\n")


def save_numpy_result(file_path, error_msg):
Expand Down Expand Up @@ -134,4 +142,6 @@ def check_result(gt_result, infer_result, args):

gt_numpy = convert2numpy(args.gt_path, args.conf_threshold)
infer_numpy = convert2numpy(args.result_path, args.conf_threshold)
gt_numpy = all_sort(gt_numpy)
infer_numpy = all_sort(infer_numpy)
check_result(gt_numpy, infer_numpy, args)

0 comments on commit c7277ef

Please sign in to comment.