Skip to content

Commit adc743c

Browse files
authored
tag exported ply files (#3472)
* tag exported ply files * Added the version * fix import order * Added information about the up-axis
1 parent 67be060 commit adc743c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nerfstudio/scripts/exporter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import typing
2525
from collections import OrderedDict
2626
from dataclasses import dataclass, field
27+
from importlib.metadata import version
2728
from pathlib import Path
2829
from typing import List, Optional, Tuple, Union, cast
2930

@@ -534,10 +535,12 @@ def write_ply(
534535
raise ValueError("All tensors must be numpy arrays of float or uint8 type and not empty")
535536

536537
with open(filename, "wb") as ply_file:
538+
nerfstudio_version = version("nerfstudio")
537539
# Write PLY header
538540
ply_file.write(b"ply\n")
539541
ply_file.write(b"format binary_little_endian 1.0\n")
540-
542+
ply_file.write(f"comment Generated by Nerstudio {nerfstudio_version}\n".encode())
543+
ply_file.write(b"comment Vertical Axis: z\n")
541544
ply_file.write(f"element vertex {count}\n".encode())
542545

543546
# Write properties, in order due to OrderedDict

0 commit comments

Comments
 (0)