Spaces:
Runtime error
Runtime error
brjathu
commited on
Commit
•
7d88ab6
1
Parent(s):
f5397b2
Adding HF files
Browse files- requirements.txt +7 -6
- vendor/pyrender/pyrender/offscreen.py +19 -21
requirements.txt
CHANGED
@@ -9,14 +9,15 @@
|
|
9 |
# timm
|
10 |
# OmegaConf
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
|
16 |
|
17 |
-
--extra-index-url https://download.pytorch.org/whl/cpu
|
18 |
-
torch==1.13.1+cpu
|
19 |
-
torchvision==0.14.1+cpu
|
|
|
20 |
pytorch-lightning
|
21 |
smplx==0.1.28
|
22 |
opencv-python
|
|
|
9 |
# timm
|
10 |
# OmegaConf
|
11 |
|
12 |
+
--extra-index-url https://download.pytorch.org/whl/cu116
|
13 |
+
torch==1.13.1+cu116
|
14 |
+
torchvision==0.14.1+cu116
|
15 |
|
16 |
|
17 |
+
# --extra-index-url https://download.pytorch.org/whl/cpu
|
18 |
+
# torch==1.13.1+cpu
|
19 |
+
# torchvision==0.14.1+cpu
|
20 |
+
|
21 |
pytorch-lightning
|
22 |
smplx==0.1.28
|
23 |
opencv-python
|
vendor/pyrender/pyrender/offscreen.py
CHANGED
@@ -127,27 +127,25 @@ class OffscreenRenderer(object):
|
|
127 |
gc.collect()
|
128 |
|
129 |
def _create(self):
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
# os.environ['PYOPENGL_PLATFORM']
|
150 |
-
# ))
|
151 |
self._platform.init_context()
|
152 |
self._platform.make_current()
|
153 |
self._renderer = Renderer(self.viewport_width, self.viewport_height)
|
|
|
127 |
gc.collect()
|
128 |
|
129 |
def _create(self):
|
130 |
+
if 'PYOPENGL_PLATFORM' not in os.environ:
|
131 |
+
from pyrender.platforms.pyglet_platform import PygletPlatform
|
132 |
+
self._platform = PygletPlatform(self.viewport_width,
|
133 |
+
self.viewport_height)
|
134 |
+
elif os.environ['PYOPENGL_PLATFORM'] == 'egl':
|
135 |
+
from pyrender.platforms import egl
|
136 |
+
device_id = int(os.environ.get('EGL_DEVICE_ID', '0'))
|
137 |
+
egl_device = egl.get_device_by_index(device_id)
|
138 |
+
self._platform = egl.EGLPlatform(self.viewport_width,
|
139 |
+
self.viewport_height,
|
140 |
+
device=egl_device)
|
141 |
+
elif os.environ['PYOPENGL_PLATFORM'] == 'osmesa':
|
142 |
+
from pyrender.platforms.osmesa import OSMesaPlatform
|
143 |
+
self._platform = OSMesaPlatform(self.viewport_width,
|
144 |
+
self.viewport_height)
|
145 |
+
else:
|
146 |
+
raise ValueError('Unsupported PyOpenGL platform: {}'.format(
|
147 |
+
os.environ['PYOPENGL_PLATFORM']
|
148 |
+
))
|
|
|
|
|
149 |
self._platform.init_context()
|
150 |
self._platform.make_current()
|
151 |
self._renderer = Renderer(self.viewport_width, self.viewport_height)
|