VeuReu commited on
Commit
6ace9bb
·
verified ·
1 Parent(s): bed3a49

Upload 2 files

Browse files
Files changed (2) hide show
  1. requirements.txt +2 -2
  2. vision_tools.py +4 -0
requirements.txt CHANGED
@@ -32,8 +32,8 @@ scenedetect==0.5.6
32
  pytesseract>=0.3
33
  easyocr>=1.7
34
  Pillow>=10.4
35
- face-recognition>=1.3.0
36
- deepface>=0.0.79
37
 
38
  # Embeddings / ML
39
  scikit-learn==1.4.2
 
32
  pytesseract>=0.3
33
  easyocr>=1.7
34
  Pillow>=10.4
35
+ # face-recognition>=1.3.0 # Requires dlib/cmake - optional, handled gracefully in code
36
+ # deepface>=0.0.79 # Heavy dependency - optional, handled gracefully in code
37
 
38
  # Embeddings / ML
39
  scikit-learn==1.4.2
vision_tools.py CHANGED
@@ -133,8 +133,12 @@ class FaceAnalyzer:
133
  if actions is None:
134
  actions = ["age", "gender"]
135
  self.actions = actions
 
 
136
 
137
  def analyze_image(self, img_path: str) -> Optional[Dict[str, Any]]:
 
 
138
  try:
139
  result = DeepFace.analyze(img_path=img_path, actions=self.actions)
140
 
 
133
  if actions is None:
134
  actions = ["age", "gender"]
135
  self.actions = actions
136
+ if DeepFace is None:
137
+ log.warning("DeepFace not available - FaceAnalyzer will return None")
138
 
139
  def analyze_image(self, img_path: str) -> Optional[Dict[str, Any]]:
140
+ if DeepFace is None:
141
+ return None
142
  try:
143
  result = DeepFace.analyze(img_path=img_path, actions=self.actions)
144