Reachy Mini documentation

تتبع الرأس

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

تتبع الرأس

يتيح هذا المثال تفعيل تتبع الرأس على جانب الخادم: يقوم Reachy Mini بتوجيه رأسه لمتابعة أقرب وجه، مستهدفاً الأنف. يتم تنفيذ الكشف داخل الخادم (YuNet على ONNX Runtime)، لذا فإن السكربت يقتصر على تبديل التتبع واستهداف أحدث وجه.

شغّل باستخدام:

python head_tracking.py

يقبل start_head_tracking(weight=...) معامل خلط: 1.0 يمنح التتبع السيطرة على الرأس، بينما 0.0 يوقف الكشف (محرراً الرأس ومعالج وحدة المعالجة المركزية) دون إيقاف المتتبع — وهو مفيد لإعادة الرأس إلى تطبيق ما بين جولات المحادثة.


from reachy_mini import ReachyMini

with ReachyMini() as mini:
    mini.start_head_tracking()
    try:
        while True:
            # Waits for the next daemon status broadcast, so the loop runs at ~1 Hz.
            face = mini.get_tracked_face()
            if face.detected:
                print(f"Face at x={face.x:+.2f}, y={face.y:+.2f}")
            else:
                print("No face detected")
    except KeyboardInterrupt:
        pass
    finally:
        mini.stop_head_tracking()
Update on GitHub