mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-14 03:44:02 +08:00
tag exported ply files (#3472)
* tag exported ply files * Added the version * fix import order * Added information about the up-axis
This commit is contained in:
1 parent
67be06009e
commit
adc743c3a0
1 file changed
+4
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user