FabienDanieau commited on
Commit
70b7a0a
·
1 Parent(s): 4614e2d

bug #60: display message when yolo is used but dependencies not installed

Browse files
src/reachy_mini_conversation_demo/vision/yolo_head_tracker.py CHANGED
@@ -3,8 +3,15 @@ import logging
3
  from typing import Tuple, Optional
4
 
5
  import numpy as np
6
- from supervision import Detections
7
- from ultralytics import YOLO
 
 
 
 
 
 
 
8
  from huggingface_hub import hf_hub_download
9
 
10
 
 
3
  from typing import Tuple, Optional
4
 
5
  import numpy as np
6
+
7
+
8
+ try:
9
+ from supervision import Detections
10
+ from ultralytics import YOLO
11
+ except ImportError as e:
12
+ raise ImportError(
13
+ "To use YOLO head tracker, please install the extra dependencies: pip install '.[yolo_vision]'"
14
+ ) from e
15
  from huggingface_hub import hf_hub_download
16
 
17