Spaces:
Runtime error
Runtime error
fix: example inputs
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def detect(
|
|
54 |
for pred in preds:
|
55 |
box = pred["bbox"]
|
56 |
box, score = box[:4], box[4]
|
57 |
-
if score <
|
58 |
continue
|
59 |
box = np.round(box).astype(int)
|
60 |
|
@@ -64,7 +64,7 @@ def detect(
|
|
64 |
|
65 |
pred_pts = pred["keypoints"]
|
66 |
for *pt, score in pred_pts:
|
67 |
-
if score <
|
68 |
color = (0, 255, 255)
|
69 |
else:
|
70 |
color = (0, 0, 255)
|
@@ -94,7 +94,7 @@ def main():
|
|
94 |
args = parser.parse_args()
|
95 |
|
96 |
image_paths = load_sample_image_paths()
|
97 |
-
examples = [[path.as_posix(),
|
98 |
|
99 |
detector = anime_face_detector.create_detector(args.detector, device=args.device)
|
100 |
func = functools.partial(detect, detector=detector)
|
|
|
54 |
for pred in preds:
|
55 |
box = pred["bbox"]
|
56 |
box, score = box[:4], box[4]
|
57 |
+
if score < face_score_threshold:
|
58 |
continue
|
59 |
box = np.round(box).astype(int)
|
60 |
|
|
|
64 |
|
65 |
pred_pts = pred["keypoints"]
|
66 |
for *pt, score in pred_pts:
|
67 |
+
if score < landmark_score_threshold:
|
68 |
color = (0, 255, 255)
|
69 |
else:
|
70 |
color = (0, 0, 255)
|
|
|
94 |
args = parser.parse_args()
|
95 |
|
96 |
image_paths = load_sample_image_paths()
|
97 |
+
examples = [[path.as_posix(), 0.5, 0.3] for path in image_paths]
|
98 |
|
99 |
detector = anime_face_detector.create_detector(args.detector, device=args.device)
|
100 |
func = functools.partial(detect, detector=detector)
|