kaifz commited on
Commit
ccf4125
·
1 Parent(s): ef3c96f

remove open3d

Browse files
app.py CHANGED
@@ -58,8 +58,6 @@ diff_gaussian_rasterization = importlib.import_module("diff_gaussian_rasterizati
58
  os.system('pip install dgl -f https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html')
59
  # os.system('conda install conda-forge::ffmpeg')
60
 
61
- from dgl.geometry import farthest_point_sampler
62
-
63
  import sys
64
  sys.path.insert(0, str(Path(__file__).parent / "src"))
65
  sys.path.append(str(Path(__file__).parent / "src" / "experiments"))
@@ -88,6 +86,7 @@ def mat2quat(mat):
88
 
89
 
90
  def fps(x, enabled, n, device, random_start=False):
 
91
  assert torch.diff(enabled * 1.0).sum() in [0.0, -1.0]
92
  start_idx = random.randint(0, enabled.sum() - 1) if random_start else 0
93
  fps_idx = farthest_point_sampler(x[enabled][None], n, start_idx=start_idx)[0]
 
58
  os.system('pip install dgl -f https://data.dgl.ai/wheels/torch-2.4/cu124/repo.html')
59
  # os.system('conda install conda-forge::ffmpeg')
60
 
 
 
61
  import sys
62
  sys.path.insert(0, str(Path(__file__).parent / "src"))
63
  sys.path.append(str(Path(__file__).parent / "src" / "experiments"))
 
86
 
87
 
88
  def fps(x, enabled, n, device, random_start=False):
89
+ from dgl.geometry import farthest_point_sampler
90
  assert torch.diff(enabled * 1.0).sum() in [0.0, -1.0]
91
  start_idx = random.randint(0, enabled.sum() - 1) if random_start else 0
92
  fps_idx = farthest_point_sampler(x[enabled][None], n, start_idx=start_idx)[0]
src/experiments/real_world/gs/helpers.py CHANGED
@@ -1,6 +1,6 @@
1
  import torch
2
  import os
3
- import open3d as o3d
4
  import numpy as np
5
  from pathlib import Path
6
  import importlib
@@ -98,6 +98,7 @@ def quat_mult(q1, q2):
98
 
99
 
100
  def o3d_knn(pts, num_knn):
 
101
  indices = []
102
  sq_dists = []
103
  pcd = o3d.geometry.PointCloud()
@@ -118,6 +119,7 @@ def o3d_knn(pts, num_knn):
118
  return np.array(sq_dists), np.array(indices)
119
 
120
  def o3d_knn_tensor(pts_tensor, num_knn):
 
121
  if pts_tensor.numel() == 0:
122
  print("Point cloud is empty!")
123
  return None, None
 
1
  import torch
2
  import os
3
+ # import open3d as o3d
4
  import numpy as np
5
  from pathlib import Path
6
  import importlib
 
98
 
99
 
100
  def o3d_knn(pts, num_knn):
101
+ import open3d as o3d
102
  indices = []
103
  sq_dists = []
104
  pcd = o3d.geometry.PointCloud()
 
119
  return np.array(sq_dists), np.array(indices)
120
 
121
  def o3d_knn_tensor(pts_tensor, num_knn):
122
+ import open3d as o3d
123
  if pts_tensor.numel() == 0:
124
  print("Point cloud is empty!")
125
  return None, None