jev-aleks commited on
Commit
b748fa4
·
1 Parent(s): 99f783b

open3d fix

Browse files
Files changed (2) hide show
  1. app.py +9 -10
  2. open3d_fix.py +9 -0
app.py CHANGED
@@ -7,21 +7,22 @@ import sys
7
  import yaml
8
 
9
  import numpy as np
10
- #import open3d as o3d
 
11
 
12
  import gradio as gr
13
  import spaces
14
  import torch
15
 
16
- #sys.path.append("./sscbench")
17
- #from sscbench.gen_voxelgrid_npy import save_as_voxel_ply, classes_to_colors
18
  from download_checkpoint_hf import download_scenedino_checkpoint
19
 
20
- #from demo_utils.utils import (load_modules,
21
- # load_sample_from_path,
22
- # get_fov_mask,
23
- # inference_3d,
24
- # inference_rendered_2d)
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='')