APEXPRIT commited on
Commit
155810c
·
verified ·
1 Parent(s): 01ffe04

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. Dockerfile +0 -2
  2. requirements.txt +16 -16
  3. src/facial/extractor.py +5 -1
Dockerfile CHANGED
@@ -19,9 +19,7 @@ WORKDIR /app
19
  COPY requirements.txt .
20
 
21
  # Install dependencies
22
- # We use opencv-python-headless for the server environment
23
  RUN pip install --no-cache-dir -r requirements.txt
24
- RUN pip install --no-cache-dir opencv-python-headless
25
 
26
  # Copy the rest of the application code
27
  COPY . .
 
19
  COPY requirements.txt .
20
 
21
  # Install dependencies
 
22
  RUN pip install --no-cache-dir -r requirements.txt
 
23
 
24
  # Copy the rest of the application code
25
  COPY . .
requirements.txt CHANGED
@@ -1,16 +1,16 @@
1
- opencv-python>=4.8.0
2
- mediapipe>=0.10.0
3
- librosa>=0.10.0
4
- scikit-learn>=1.3.0
5
- matplotlib>=3.7.0
6
- seaborn>=0.12.0
7
- gradio>=4.0.0
8
- numpy>=1.24.0
9
- pandas>=2.0.0
10
- shap>=0.43.0
11
- joblib>=1.3.0
12
- tqdm>=4.65.0
13
- scipy>=1.11.0
14
- fastapi>=0.100.0
15
- uvicorn>=0.23.0
16
- python-multipart>=0.0.6
 
1
+ opencv-python-headless>=4.8.0
2
+ mediapipe==0.10.11
3
+ librosa>=0.10.0
4
+ scikit-learn==1.7.2
5
+ matplotlib>=3.7.0
6
+ seaborn>=0.12.0
7
+ gradio>=4.0.0
8
+ numpy>=1.24.0
9
+ pandas>=2.0.0
10
+ shap>=0.43.0
11
+ joblib>=1.3.0
12
+ tqdm>=4.65.0
13
+ scipy>=1.11.0
14
+ fastapi>=0.100.0
15
+ uvicorn>=0.23.0
16
+ python-multipart>=0.0.6
src/facial/extractor.py CHANGED
@@ -20,7 +20,11 @@ class FacialFeatureExtractor:
20
  """Lazily load mediapipe to avoid global import errors."""
21
  try:
22
  import mediapipe as mp
23
- return mp.solutions
 
 
 
 
24
  except Exception as e:
25
  raise ImportError(
26
  "MediaPipe 'solutions' module not found. Original error: " + str(e)
 
20
  """Lazily load mediapipe to avoid global import errors."""
21
  try:
22
  import mediapipe as mp
23
+ if hasattr(mp, 'solutions'):
24
+ return mp.solutions
25
+ # Try alternative import for some linux distributions/versions
26
+ import mediapipe.python.solutions as solutions
27
+ return solutions
28
  except Exception as e:
29
  raise ImportError(
30
  "MediaPipe 'solutions' module not found. Original error: " + str(e)