Skip to content

Commit faf9220

Browse files
committed
[R] Remove git lfs to try to fix pr
1 parent 5daed92 commit faf9220

22 files changed

Lines changed: 31 additions & 53 deletions

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

demo/face_depth.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
import pyface.components as pf
55

6-
cur_folder = cb.get_curdir(__file__)
6+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
77

88

9-
def main(img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg")):
9+
def main(img_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg")):
1010
face_detect = pf.build_face_detection()
1111
face_depth = pf.build_face_depth()
1212

@@ -16,7 +16,7 @@ def main(img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg")):
1616
results = face_depth([img], [face_box], return_depth=True)
1717
plotted = face_depth.draw_results(img, [face_box], results)
1818

19-
out_folder = cur_folder / "output"
19+
out_folder = cb.get_curdir(__file__) / "output"
2020
out_folder.mkdir(exist_ok=True, parents=True)
2121
cb.imwrite(plotted, out_folder / "face_depth1.png")
2222
cb.imwrite(results[0]["depth_img"], out_folder / "face_depth2.png")

demo/face_detection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
import pyface.components as pf
77

8-
cur_folder = cb.get_curdir(__file__)
8+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
99

1010

1111
def main(
12-
img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg"),
12+
img_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg"),
1313
score_th: float = 0.5,
1414
inp_size: Tuple[int, int] = (480, 640),
1515
):
@@ -22,7 +22,7 @@ def main(
2222
proposals_list = face_detection([img] * 7)
2323
plotted = face_detection.draw_proposals(img, proposals_list[0])
2424

25-
out_folder = cur_folder / "output"
25+
out_folder = cb.get_curdir(__file__) / "output"
2626
out_folder.mkdir(exist_ok=True, parents=True)
2727
cb.imwrite(plotted, out_folder / "face_detection.png")
2828

demo/face_gender.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
import pyface.components as pf
55

6-
cur_folder = cb.get_curdir(__file__)
6+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
77

88

9-
def main(img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg")):
9+
def main(img_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg")):
1010
face_detect = pf.build_face_detection()
1111
face_gender = pf.build_gender_detection()
1212

@@ -16,7 +16,7 @@ def main(img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg")):
1616
results = face_gender([img], [face_box])
1717
plotted = face_gender.draw_results(img, [face_box], results)
1818

19-
out_folder = cur_folder / "output"
19+
out_folder = cb.get_curdir(__file__) / "output"
2020
out_folder.mkdir(exist_ok=True, parents=True)
2121
cb.imwrite(plotted, out_folder / "face_gender.png")
2222

demo/face_landmark.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
import pyface as pf
77

8-
cur_folder = cb.get_curdir(__file__)
8+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
99

1010

1111
def main(
12-
img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg"),
12+
img_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg"),
1313
score_th: float = 0.5,
1414
inp_size: Tuple[int, int] = (480, 640),
1515
):
@@ -25,7 +25,7 @@ def main(
2525
result = face_landmark([img], [box])[0]
2626
plotted = face_landmark.draw_result(img, box, result, plot_details=True)
2727

28-
out_folder = cur_folder / "output"
28+
out_folder = cb.get_curdir(__file__) / "output"
2929
out_folder.mkdir(exist_ok=True, parents=True)
3030
cb.imwrite(plotted, out_folder / "face_landmark.jpg")
3131

demo/face_normalization.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55

66
import pyface.components as pf
77

8-
cur_folder = cb.get_curdir(__file__)
8+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
99

1010

1111
def main(
12-
img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg"),
12+
img_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg"),
1313
scale: float = 1,
1414
dst_size: Tuple[int, int] = (224, 224),
1515
):
16-
face_detection = pf.SCRFD()
16+
face_detection = pf.build_face_detection()
1717
face_normaliation = pf.FaceNormalize(
1818
dst_size=dst_size,
1919
interpolation=cb.INTER.BILINEAR,
@@ -22,13 +22,9 @@ def main(
2222
img = cb.imread(img_path)
2323
proposals = face_detection([img])[0]
2424
norm_img = face_normaliation([img], [cb.Keypoints(proposals["lmk5pts"][0])])[0]
25-
norm_img = cb.draw_keypoints(
26-
norm_img,
27-
face_normaliation.destination_pts,
28-
scale=1,
29-
)
25+
norm_img = cb.draw_keypoints(norm_img, face_normaliation.destination_pts, scale=1)
3026

31-
out_folder = cur_folder / "output"
27+
out_folder = cb.get_curdir(__file__) / "output"
3228
out_folder.mkdir(exist_ok=True, parents=True)
3329
cb.imwrite(norm_img, out_folder / f"face_normalize_s={scale}.png")
3430

demo/face_recognition.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
import pyface as pf
55

6-
cur_folder = cb.get_curdir(__file__)
6+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
77

88

99
def main(
10-
src_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg"),
11-
tgt_path: str = str(cur_folder / "data" / "face_bank" / "EmmaWatson.jpg"),
10+
src_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg"),
11+
tgt_path: str = str(RESOURCE_DIR / "face_bank" / "EmmaWatson.jpg"),
1212
):
1313
face_detection = pf.build_face_detection()
1414
face_recognition = pf.build_face_recognition()
@@ -17,7 +17,7 @@ def main(
1717
tgt_img = cb.imread(tgt_path)
1818
lmks = [p["lmk5pts"][0] for p in face_detection([src_img, tgt_img])]
1919

20-
out_folder = cur_folder / "output"
20+
out_folder = cb.get_curdir(__file__) / "output"
2121
out_folder.mkdir(exist_ok=True, parents=True)
2222
results = face_recognition([src_img, tgt_img], lmks)
2323
src_emb = results[0]["embeddings"]

demo/face_service.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33

44
import pyface as pf
55

6-
cur_folder = cb.get_curdir(__file__)
6+
RESOURCE_DIR = cb.get_curdir(__file__).parent / "tests" / "resources"
77

88

99
def main(
10-
img_path: str = str(cur_folder / "data" / "EmmaWatson1.jpg"),
11-
face_bank: str = str(cur_folder / "data" / "face_bank"),
10+
img_path: str = str(RESOURCE_DIR / "EmmaWatson1.jpg"),
11+
face_bank: str = str(RESOURCE_DIR / "face_bank"),
1212
):
1313
face_service = pf.FaceService(
1414
enable_gender=True,
@@ -19,7 +19,9 @@ def main(
1919
)
2020
img = cb.imread(img_path)
2121
faces_on_img = face_service([img], do_1n=True)[0]
22-
cb.imwrite(faces_on_img.gen_info_img(), str(cur_folder / "output" / "face_service.jpg"))
22+
out_folder = cb.get_curdir(__file__) / "output"
23+
out_folder.mkdir(exist_ok=True, parents=True)
24+
cb.imwrite(faces_on_img.gen_info_img(), str(out_folder / "face_service.jpg"))
2325

2426

2527
if __name__ == "__main__":

tests/resources/EmmaWatson1.jpg

162 KB
Loading

tests/resources/EmmaWatson1.png

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)