Justin Means commited on
Commit
c1265a2
·
1 Parent(s): a85cb6c

Add PLY export when infer_gs is enabled

Browse files

The export_to_gs_ply function was never being called - only export_to_gs_video.
Now PLY files are exported alongside videos for download.

depth_anything_3/app/modules/model_inference.py CHANGED
@@ -205,7 +205,7 @@ class ModelInference:
205
  num_max_points=int(num_max_points),
206
  )
207
 
208
- # export to gs video if needed
209
  if infer_gs:
210
  mode_mapping = {"extend": "extend", "smooth": "interpolate_smooth"}
211
  print(f"GS mode: {gs_trj_mode}; Backend mode: {mode_mapping[gs_trj_mode]}")
@@ -218,6 +218,11 @@ class ModelInference:
218
  vis_depth="hcat",
219
  video_quality=gs_video_quality,
220
  )
 
 
 
 
 
221
 
222
  # Save predictions.npz for caching metric depth data
223
  self._save_predictions_cache(target_dir, prediction)
 
205
  num_max_points=int(num_max_points),
206
  )
207
 
208
+ # export to gs video and ply if needed
209
  if infer_gs:
210
  mode_mapping = {"extend": "extend", "smooth": "interpolate_smooth"}
211
  print(f"GS mode: {gs_trj_mode}; Backend mode: {mode_mapping[gs_trj_mode]}")
 
218
  vis_depth="hcat",
219
  video_quality=gs_video_quality,
220
  )
221
+ # Export PLY file for download/interactive viewing
222
+ from depth_anything_3.utils.export.gs import export_to_gs_ply
223
+ print("Exporting Gaussian Splat PLY file...")
224
+ export_to_gs_ply(prediction, export_dir=target_dir)
225
+ print(f"PLY exported to {target_dir}/gs_ply/")
226
 
227
  # Save predictions.npz for caching metric depth data
228
  self._save_predictions_cache(target_dir, prediction)