push
Browse files- Dockerfile +2 -0
- renderer.py +15 -2
- requirements.txt +2 -0
Dockerfile
CHANGED
|
@@ -26,6 +26,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
| 26 |
libxext6 \
|
| 27 |
libxrender1 \
|
| 28 |
libgl1-mesa-dri \
|
|
|
|
|
|
|
| 29 |
&& rm -rf /var/lib/apt/lists/*
|
| 30 |
|
| 31 |
# Copy requirements and install Python dependencies
|
|
|
|
| 26 |
libxext6 \
|
| 27 |
libxrender1 \
|
| 28 |
libgl1-mesa-dri \
|
| 29 |
+
mesa-common-dev \
|
| 30 |
+
libglu1-mesa-dev \
|
| 31 |
&& rm -rf /var/lib/apt/lists/*
|
| 32 |
|
| 33 |
# Copy requirements and install Python dependencies
|
renderer.py
CHANGED
|
@@ -1,11 +1,24 @@
|
|
| 1 |
import os
|
| 2 |
-
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
|
| 3 |
|
| 4 |
import numpy as np
|
| 5 |
-
import pyrender
|
| 6 |
import trimesh
|
| 7 |
from typing import Tuple, Optional
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
class AvatarRenderer:
|
| 11 |
def __init__(
|
|
|
|
| 1 |
import os
|
|
|
|
| 2 |
|
| 3 |
import numpy as np
|
|
|
|
| 4 |
import trimesh
|
| 5 |
from typing import Tuple, Optional
|
| 6 |
|
| 7 |
+
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
|
| 8 |
+
|
| 9 |
+
try:
|
| 10 |
+
import pyrender
|
| 11 |
+
except Exception as e:
|
| 12 |
+
print(f"Warning: pyrender import failed with osmesa: {e}")
|
| 13 |
+
try:
|
| 14 |
+
os.environ['PYOPENGL_PLATFORM'] = 'egl'
|
| 15 |
+
import pyrender
|
| 16 |
+
print("Using EGL platform")
|
| 17 |
+
except Exception as e2:
|
| 18 |
+
print(f"Warning: pyrender import failed with egl: {e2}")
|
| 19 |
+
os.environ['PYOPENGL_PLATFORM'] = 'osmesa'
|
| 20 |
+
import pyrender
|
| 21 |
+
|
| 22 |
|
| 23 |
class AvatarRenderer:
|
| 24 |
def __init__(
|
requirements.txt
CHANGED
|
@@ -10,4 +10,6 @@ Pillow
|
|
| 10 |
scikit-learn
|
| 11 |
git+https://github.com/mattloper/chumpy.git
|
| 12 |
scipy
|
|
|
|
|
|
|
| 13 |
|
|
|
|
| 10 |
scikit-learn
|
| 11 |
git+https://github.com/mattloper/chumpy.git
|
| 12 |
scipy
|
| 13 |
+
PyOpenGL
|
| 14 |
+
PyOpenGL-accelerate
|
| 15 |
|