Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,12 @@ import spaces
|
|
| 12 |
import torch
|
| 13 |
from PIL import Image
|
| 14 |
from functools import partial
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
from torchmcubes import marching_cubes
|
| 16 |
import mcubes
|
| 17 |
|
|
@@ -19,11 +25,7 @@ def marching_cubes(vertices, threshold):
|
|
| 19 |
# Simula la funci贸n original usando la librer铆a de CPU
|
| 20 |
v, f = mcubes.marching_cubes(vertices.detach().cpu().numpy(), threshold)
|
| 21 |
return torch.from_numpy(v), torch.from_numpy(f)
|
| 22 |
-
|
| 23 |
-
subprocess.run(shlex.split('pip install wheel/torchmcubes-0.1.0-cp310-cp310-linux_x86_64.whl'))
|
| 24 |
|
| 25 |
-
from tsr.system import TSR
|
| 26 |
-
from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
|
| 27 |
|
| 28 |
|
| 29 |
HEADER = """
|
|
|
|
| 12 |
import torch
|
| 13 |
from PIL import Image
|
| 14 |
from functools import partial
|
| 15 |
+
|
| 16 |
+
subprocess.run(shlex.split('pip install wheel/torchmcubes-0.1.0-cp310-cp310-linux_x86_64.whl'))
|
| 17 |
+
|
| 18 |
+
from tsr.system import TSR
|
| 19 |
+
from tsr.utils import remove_background, resize_foreground, to_gradio_3d_orientation
|
| 20 |
+
|
| 21 |
from torchmcubes import marching_cubes
|
| 22 |
import mcubes
|
| 23 |
|
|
|
|
| 25 |
# Simula la funci贸n original usando la librer铆a de CPU
|
| 26 |
v, f = mcubes.marching_cubes(vertices.detach().cpu().numpy(), threshold)
|
| 27 |
return torch.from_numpy(v), torch.from_numpy(f)
|
|
|
|
|
|
|
| 28 |
|
|
|
|
|
|
|
| 29 |
|
| 30 |
|
| 31 |
HEADER = """
|