Spaces:
Running
on
Zero
Running
on
Zero
open3d fix
Browse files- app.py +9 -10
- open3d_fix.py +9 -0
app.py
CHANGED
@@ -7,21 +7,22 @@ import sys
|
|
7 |
import yaml
|
8 |
|
9 |
import numpy as np
|
10 |
-
|
|
|
11 |
|
12 |
import gradio as gr
|
13 |
import spaces
|
14 |
import torch
|
15 |
|
16 |
-
|
17 |
-
|
18 |
from download_checkpoint_hf import download_scenedino_checkpoint
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
|
27 |
# Load checkpoints from Hugging Face
|
@@ -64,8 +65,6 @@ def demo_run(image: str,
|
|
64 |
y_range: int,
|
65 |
z_range: int):
|
66 |
|
67 |
-
return image
|
68 |
-
|
69 |
if net_v1 is None:
|
70 |
load_scenedino()
|
71 |
|
|
|
7 |
import yaml
|
8 |
|
9 |
import numpy as np
|
10 |
+
import open3d_fix
|
11 |
+
import open3d as o3d
|
12 |
|
13 |
import gradio as gr
|
14 |
import spaces
|
15 |
import torch
|
16 |
|
17 |
+
sys.path.append("./sscbench")
|
18 |
+
from sscbench.gen_voxelgrid_npy import save_as_voxel_ply, classes_to_colors
|
19 |
from download_checkpoint_hf import download_scenedino_checkpoint
|
20 |
|
21 |
+
from demo_utils.utils import (load_modules,
|
22 |
+
load_sample_from_path,
|
23 |
+
get_fov_mask,
|
24 |
+
inference_3d,
|
25 |
+
inference_rendered_2d)
|
26 |
|
27 |
|
28 |
# Load checkpoints from Hugging Face
|
|
|
65 |
y_range: int,
|
66 |
z_range: int):
|
67 |
|
|
|
|
|
68 |
if net_v1 is None:
|
69 |
load_scenedino()
|
70 |
|
open3d_fix.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Fix as suggested in https://huggingface.co/spaces/TencentARC/FreeSplatter/discussions/3
|
2 |
+
|
3 |
+
import fileinput
|
4 |
+
import site
|
5 |
+
from pathlib import Path
|
6 |
+
|
7 |
+
with fileinput.FileInput(f'{site.getsitepackages()[0]}/open3d/__init__.py', inplace=True) as file:
|
8 |
+
for line in file:
|
9 |
+
print(line.replace('_pybind_cuda.open3d_core_cuda_device_count()', '1'), end='')
|