Skip to content

Commit 1d53ca1

Browse files
Amend test.py for os dependendent directory separator char
It was failing on Windows
1 parent 7b0500a commit 1d53ca1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/test_find.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import cv2
23
import pandas as pd
34
from deepface import DeepFace
@@ -10,7 +11,7 @@
1011

1112

1213
def test_find_with_exact_path():
13-
img_path = "dataset/img1.jpg"
14+
img_path = os.path.join("dataset","img1.jpg")
1415
dfs = DeepFace.find(img_path=img_path, db_path="dataset", silent=True)
1516
assert len(dfs) > 0
1617
for df in dfs:
@@ -30,7 +31,7 @@ def test_find_with_exact_path():
3031

3132

3233
def test_find_with_array_input():
33-
img_path = "dataset/img1.jpg"
34+
img_path = os.path.join("dataset","img1.jpg")
3435
img1 = cv2.imread(img_path)
3536
dfs = DeepFace.find(img1, db_path="dataset", silent=True)
3637
assert len(dfs) > 0
@@ -52,7 +53,7 @@ def test_find_with_array_input():
5253

5354

5455
def test_find_with_extracted_faces():
55-
img_path = "dataset/img1.jpg"
56+
img_path = os.path.join("dataset","img1.jpg")
5657
face_objs = DeepFace.extract_faces(img_path)
5758
img = face_objs[0]["face"]
5859
dfs = DeepFace.find(img, db_path="dataset", detector_backend="skip", silent=True)

0 commit comments

Comments
 (0)