Skip to content

Commit 351f085

Browse files
committed
[F] try to fix pickle in container
1 parent 878ec79 commit 351f085

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/test_face_depth.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
def test_face_depth(data):
2828
m = build_face_depth(backend="cpu")
2929
img = cb.imread(data["img_fpath"])
30-
expected = np.load(data["expected"], allow_pickle=False)
31-
boxes = np.load(data["detect"], allow_pickle=False)["boxes"]
30+
expected = np.load(data["expected"], allow_pickle=True)
31+
boxes = np.load(data["detect"], allow_pickle=True)["boxes"]
3232
results = m(imgs=[img], boxes=cb.Boxes(boxes), return_depth=True)[0]
3333

3434
assert_allclose(results["param"], expected["param"])
@@ -41,8 +41,8 @@ def test_face_depth(data):
4141
def test_face_depth_batch(data):
4242
m = build_face_depth(batch_size=4)
4343
img = cb.imread(data["img_fpath"])
44-
expected = np.load(data["expected"], allow_pickle=False)
45-
boxes = np.load(data["detect"], allow_pickle=False)["boxes"]
44+
expected = np.load(data["expected"], allow_pickle=True)
45+
boxes = np.load(data["detect"], allow_pickle=True)["boxes"]
4646
results = m(imgs=[img] * 6, boxes=cb.Boxes(np.tile(boxes, (6, 1))), return_depth=True)
4747

4848
for result in results:
@@ -56,7 +56,7 @@ def gen_target():
5656
m = build_face_depth(backend="cpu")
5757
for data in TEST_DATA:
5858
img = cb.imread(data["img_fpath"])
59-
boxes = np.load(data["detect"], allow_pickle=False)["boxes"]
59+
boxes = np.load(data["detect"], allow_pickle=True)["boxes"]
6060
results = m(imgs=[img], boxes=cb.Boxes(boxes), return_depth=True)[0]
6161
np.savez_compressed(
6262
data["expected"],

tests/test_face_detection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_face_detection(data):
4242
def test_face_detection_cpu(data):
4343
m = pf.build_face_detection(name="scrfd", model_name="scrfd_10g_gnkps_fp32", backend="cpu")
4444
img = cb.imread(data["img_fpath"])
45-
expected = np.load(data["expected"], allow_pickle=False)
45+
expected = np.load(data["expected"], allow_pickle=True)
4646
faces_on_img = m(imgs=[img] * 8)[0]
4747

4848
assert faces_on_img["infos"]["num_proposals"]
@@ -60,7 +60,7 @@ def test_face_detection_batch(data):
6060
backend=cb.get_recommended_backend(),
6161
)
6262
img = cb.imread(data["img_fpath"])
63-
expected = np.load(data["expected"], allow_pickle=False)
63+
expected = np.load(data["expected"], allow_pickle=True)
6464
faces_list = m(imgs=[img] * 5)
6565
for faces in faces_list:
6666
assert faces["infos"]["num_proposals"]

0 commit comments

Comments
 (0)