Update models/ISOMER/mesh_reconstruction/render.py
Browse files
models/ISOMER/mesh_reconstruction/render.py
CHANGED
|
@@ -16,9 +16,12 @@ def _warmup(glctx, device=None):
|
|
| 16 |
dr.rasterize(glctx, pos, tri, resolution=[256, 256])
|
| 17 |
|
| 18 |
# glctx = dr.RasterizeGLContext(output_db=False, device="cuda")
|
|
|
|
| 19 |
@spaces.GPU
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
| 22 |
class NormalsRenderer:
|
| 23 |
|
| 24 |
_glctx:dr.RasterizeCudaContext = None
|
|
|
|
| 16 |
dr.rasterize(glctx, pos, tri, resolution=[256, 256])
|
| 17 |
|
| 18 |
# glctx = dr.RasterizeGLContext(output_db=False, device="cuda")
|
| 19 |
+
glctx = None
|
| 20 |
@spaces.GPU
|
| 21 |
+
def init_render():
|
| 22 |
+
global glctx
|
| 23 |
+
glctx = dr.RasterizeCudaContext(device="cuda")
|
| 24 |
+
init_render()
|
| 25 |
class NormalsRenderer:
|
| 26 |
|
| 27 |
_glctx:dr.RasterizeCudaContext = None
|