Skip to content

Commit f497b06

Browse files
committed
* Use yolo model when running app_face_tracking
1 parent 15c37a1 commit f497b06

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

projects/app_face_tracking/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
from maix import image, camera, display, time, nn, touchscreen, sys
33

44
### model path
5-
MODEL = "/root/models/retinaface.mud"
5+
if sys.device_name().lower() == "maixcam2":
6+
MODEL = "/root/models/yolo11s_face.mud"
7+
else:
8+
MODEL = "/root/models/retinaface.mud"
69

710

811

@@ -24,7 +27,10 @@ def __init__(self, out_range:float, ignore_limit:float, path:str):
2427
self.ignore = ignore_limit
2528

2629
### Self.w and self.h must be initialized.
27-
self.detector = nn.Retinaface(model=path)
30+
if sys.device_name().lower() == "maixcam2":
31+
self.detector = nn.YOLO11(model=path)
32+
else:
33+
self.detector = nn.Retinaface(model=path)
2834
self.w = self.detector.input_width()
2935
self.h = self.detector.input_height()
3036
self.cam = camera.Camera(self.w, self.h)

0 commit comments

Comments
 (0)