@@ -252,55 +252,44 @@ def init_from_colmap(self, root_path: str, observer_pts):
252252 file_pts , observer_pts , file_rgb , use_observer_pts = self .conf .initialization .use_observation_points
253253 )
254254
255- def init_from_accumulated_point_cloud (self , pc_path : str , observer_pts ):
255+ def init_from_fused_point_cloud (self , pc_path : str , observer_pts ):
256256 """
257- Initialize gaussians from an accumulated point cloud PLY file.
257+ Initialize gaussians from an fused point cloud PLY file.
258258 Similar to init_from_colmap but loads from a given PLY file instead of sparse/0/points3D.txt
259-
259+
260260 Args:
261261 pc_path: Path to the PLY point cloud file
262262 observer_pts: Observer points tensor for scale initialization
263263 """
264- logger .info (f"Loading accumulated point cloud from { pc_path } ..." )
265-
264+ logger .info (f"Loading fused point cloud from { pc_path } ..." )
265+
266266 # Read PLY file
267267 plydata = PlyData .read (pc_path )
268- vertices = plydata [' vertex' ]
269-
268+ vertices = plydata [" vertex" ]
269+
270270 # Extract XYZ coordinates
271- xyz = np .stack ([
272- vertices ['x' ],
273- vertices ['y' ],
274- vertices ['z' ]
275- ], axis = 1 ).astype (np .float32 )
276-
271+ xyz = np .stack ([vertices ["x" ], vertices ["y" ], vertices ["z" ]], axis = 1 ).astype (np .float32 )
272+
277273 # Extract RGB colors (check if they exist)
278- if 'red' in vertices and 'green' in vertices and 'blue' in vertices :
279- rgb = np .stack ([
280- vertices ['red' ],
281- vertices ['green' ],
282- vertices ['blue' ]
283- ], axis = 1 ).astype (np .uint8 )
274+ if "red" in vertices and "green" in vertices and "blue" in vertices :
275+ rgb = np .stack ([vertices ["red" ], vertices ["green" ], vertices ["blue" ]], axis = 1 ).astype (np .uint8 )
284276 else :
285277 # If no colors, initialize with random colors
286278 logger .warning ("No RGB data found in point cloud, using random colors" )
287279 rgb = np .random .randint (0 , 256 , size = (len (vertices ), 3 ), dtype = np .uint8 )
288-
280+
289281 # Convert to torch tensors
290282 file_pts = torch .tensor (xyz , dtype = torch .float32 , device = self .device )
291283 file_rgb = torch .tensor (rgb , dtype = torch .uint8 , device = self .device )
292-
284+
293285 logger .info (f"Loaded { len (file_pts )} points from accumulated point cloud" )
294-
286+
295287 # Initialize using the same method as COLMAP
296288 assert file_rgb .dtype == torch .uint8 , "Expecting RGB values to be in [0, 255] range"
297289 self .default_initialize_from_points (
298- file_pts ,
299- observer_pts ,
300- file_rgb ,
301- use_observer_pts = self .conf .initialization .use_observation_points
290+ file_pts , observer_pts , file_rgb , use_observer_pts = self .conf .initialization .use_observation_points
302291 )
303-
292+
304293 def init_from_pretrained_point_cloud (self , pc_path : str , set_optimizable_parameters : bool = True ):
305294 data = PlyData .read (pc_path )
306295 num_gaussians = len (data ["vertex" ])
0 commit comments