Commit ·
6fedc97
1
Parent(s): 9dc2f54
fix: libgles2/libegl1 in Dockerfile + handle missing mp.solutions namespace
Browse filesTwo runtime errors observed on the live Space:
1. libGLESv2.so.2 missing — added libgles2 + libegl1 to apt-get install.
MediaPipe needs both the OpenGL and OpenGL ES variants on Linux.
2. AttributeError: module 'mediapipe' has no attribute 'solutions' —
MediaPipe 0.10.15+ deprecated the legacy `mp.solutions` namespace; the
Holistic solution moved to mediapipe-extended. Production fingerspelling
already uses the Tasks API (signbridge.recognizer.landmark_classifier),
so the Holistic-based pose-debug overlay is now optional. landmarks.py
handles the missing namespace gracefully — logs and returns early
instead of crashing the Space's import path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Dockerfile +2 -0
- signbridge/recognizer/landmarks.py +14 -2
Dockerfile
CHANGED
|
@@ -5,6 +5,8 @@ FROM python:3.11-slim
|
|
| 5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
git \
|
| 7 |
libgl1 \
|
|
|
|
|
|
|
| 8 |
libglib2.0-0 \
|
| 9 |
libsm6 \
|
| 10 |
libxext6 \
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
git \
|
| 7 |
libgl1 \
|
| 8 |
+
libgles2 \
|
| 9 |
+
libegl1 \
|
| 10 |
libglib2.0-0 \
|
| 11 |
libsm6 \
|
| 12 |
libxext6 \
|
signbridge/recognizer/landmarks.py
CHANGED
|
@@ -40,8 +40,20 @@ class LandmarkExtractor:
|
|
| 40 |
import mediapipe as mp # type: ignore[import-not-found]
|
| 41 |
except ImportError:
|
| 42 |
logger.warning(
|
| 43 |
-
"mediapipe not installed; landmarks will be all zeros.
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
)
|
| 46 |
return
|
| 47 |
self._mp_drawing = mp.solutions.drawing_utils
|
|
|
|
| 40 |
import mediapipe as mp # type: ignore[import-not-found]
|
| 41 |
except ImportError:
|
| 42 |
logger.warning(
|
| 43 |
+
"mediapipe not installed; landmarks will be all zeros."
|
| 44 |
+
)
|
| 45 |
+
return
|
| 46 |
+
# MediaPipe 0.10.15+ deprecated and eventually removed the legacy
|
| 47 |
+
# `mp.solutions` namespace in favour of `mp.tasks`. The Holistic
|
| 48 |
+
# solution moved to `mediapipe-extended` and isn't critical for the
|
| 49 |
+
# production fingerspelling path (that uses Tasks API in
|
| 50 |
+
# signbridge.recognizer.landmark_classifier). When `solutions` is
|
| 51 |
+
# missing we silently skip the pose-debug overlay rather than
|
| 52 |
+
# crashing the whole Space.
|
| 53 |
+
if not hasattr(mp, "solutions"):
|
| 54 |
+
logger.info(
|
| 55 |
+
"mediapipe.solutions not available (Holistic deprecated); "
|
| 56 |
+
"pose-tracking debug overlay disabled."
|
| 57 |
)
|
| 58 |
return
|
| 59 |
self._mp_drawing = mp.solutions.drawing_utils
|