diff --git a/scripts/exporter.py b/scripts/exporter.py index a555de98c..cd18aa354 100644 --- a/scripts/exporter.py +++ b/scripts/exporter.py @@ -2,6 +2,8 @@ Script for exporting NeRF into other formats. """ +# pylint: disable=no-member + from __future__ import annotations import json @@ -94,7 +96,11 @@ class ExportPointCloud(Exporter): CONSOLE.print(f"[bold green]:white_check_mark: Generated {pcd}") CONSOLE.print("Saving Point Cloud...") - o3d.io.write_point_cloud(str(self.output_dir / "point_cloud.ply"), pcd) + tpcd = o3d.t.geometry.PointCloud.from_legacy(pcd) + # The legacy PLY writer converts colors to UInt8, + # let us do the same to save space. + tpcd.point.colors = (tpcd.point.colors * 255).to(o3d.core.Dtype.UInt8) + o3d.t.io.write_point_cloud(str(self.output_dir / "point_cloud.ply"), tpcd) print("\033[A\033[A") CONSOLE.print("[bold green]:white_check_mark: Saving Point Cloud")