Modify model tests

This commit is contained in:
jiangjiajun
2022-11-05 07:54:16 +00:00
parent f00212aa42
commit cf8f53e36d
7 changed files with 111 additions and 92 deletions

View File

@@ -20,8 +20,8 @@ import runtime_config as rc
def test_keypointdetection_pptinypose():
pp_tinypose_model_url = "https://bj.bcebos.com/fastdeploy/tests/PP_TinyPose_256x192_test.tgz"
fd.download_and_decompress(pp_tinypose_model_url, ".")
model_path = "./PP_TinyPose_256x192_test"
fd.download_and_decompress(pp_tinypose_model_url, "resources")
model_path = "./resources/PP_TinyPose_256x192_test"
# 配置runtime加载模型
runtime_option = fd.RuntimeOption()
model_file = os.path.join(model_path, "model.pdmodel")
@@ -48,8 +48,8 @@ def test_keypointdetection_pptinypose():
def test_keypointdetection_det_keypoint_unite():
det_keypoint_unite_model_url = "https://bj.bcebos.com/fastdeploy/tests/PicoDet_320x320_TinyPose_256x192_test.tgz"
fd.download_and_decompress(det_keypoint_unite_model_url, ".")
model_path = "./PicoDet_320x320_TinyPose_256x192_test"
fd.download_and_decompress(det_keypoint_unite_model_url, "resources")
model_path = "./resources/PicoDet_320x320_TinyPose_256x192_test"
# 配置runtime加载模型
runtime_option = fd.RuntimeOption()
tinypose_model_file = os.path.join(
@@ -91,7 +91,7 @@ def test_keypointdetection_det_keypoint_unite():
(np.array(result.keypoints), np.array(result.scores)[:, np.newaxis]),
axis=1)
print(result)
np.save("baseline.npy", result)
np.save("resources/baseline.npy", result)
baseline = np.load(baseline_file)
diff = np.fabs(result - np.array(baseline))
thres = 1e-05