Stanislaw Szymanowicz commited on
Commit
d9b08ef
1 Parent(s): 15f992e

Update export to .ply

Browse files
Files changed (1) hide show
  1. utils/app_utils.py +2 -1
utils/app_utils.py CHANGED
@@ -163,7 +163,8 @@ def export_to_obj(reconstruction, ply_out_path):
163
  f_dc = reconstruction["features_dc"].detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
164
  f_rest = reconstruction["features_rest"].detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
165
  opacities = reconstruction["opacity"].detach().cpu().numpy()
166
- scale = reconstruction["scaling"].detach().cpu().numpy()
 
167
  rotation = reconstruction["rotation"].detach().cpu().numpy()
168
 
169
  dtype_full = [(attribute, 'f4') for attribute in construct_list_of_attributes()]
 
163
  f_dc = reconstruction["features_dc"].detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
164
  f_rest = reconstruction["features_rest"].detach().transpose(1, 2).flatten(start_dim=1).contiguous().cpu().numpy()
165
  opacities = reconstruction["opacity"].detach().cpu().numpy()
166
+ # enlarge Gaussians - otherwise transforming them to .ply results in artefacts
167
+ scale = reconstruction["scaling"].detach().cpu().numpy() + np.abs(reconstruction["scaling"].detach().cpu().numpy() * 0.1)
168
  rotation = reconstruction["rotation"].detach().cpu().numpy()
169
 
170
  dtype_full = [(attribute, 'f4') for attribute in construct_list_of_attributes()]