From adc743c3a0cd0fc4623e166de304f4324ee3ff9a Mon Sep 17 00:00:00 2001 From: Simon Bethke Date: Mon, 14 Oct 2024 03:48:52 +0200 Subject: [PATCH] tag exported ply files (#3472) * tag exported ply files * Added the version * fix import order * Added information about the up-axis --- nerfstudio/scripts/exporter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nerfstudio/scripts/exporter.py b/nerfstudio/scripts/exporter.py index 9c0812e3e..b6404af37 100644 --- a/nerfstudio/scripts/exporter.py +++ b/nerfstudio/scripts/exporter.py @@ -24,6 +24,7 @@ import sys import typing from collections import OrderedDict from dataclasses import dataclass, field +from importlib.metadata import version from pathlib import Path from typing import List, Optional, Tuple, Union, cast @@ -534,10 +535,12 @@ class ExportGaussianSplat(Exporter): raise ValueError("All tensors must be numpy arrays of float or uint8 type and not empty") with open(filename, "wb") as ply_file: + nerfstudio_version = version("nerfstudio") # Write PLY header ply_file.write(b"ply\n") ply_file.write(b"format binary_little_endian 1.0\n") - + ply_file.write(f"comment Generated by Nerstudio {nerfstudio_version}\n".encode()) + ply_file.write(b"comment Vertical Axis: z\n") ply_file.write(f"element vertex {count}\n".encode()) # Write properties, in order due to OrderedDict