nvs2colmap 0.3.0__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/PKG-INFO +3 -2
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/README.md +1 -1
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/dynamic3dgs/__main__.py +8 -0
- nvs2colmap-0.3.1/nvs2colmap/dynamic3dgs/points.py +25 -0
- nvs2colmap-0.3.1/nvs2colmap/write_pcd.py +36 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap.egg-info/PKG-INFO +3 -2
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap.egg-info/SOURCES.txt +4 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap.egg-info/requires.txt +1 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/pyproject.toml +2 -1
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/LICENSE +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/__init__.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/colmap.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/dynamic3dgs/camera_meta.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/dynamic3dgs/link_frames.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/extract_videos.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/n3dv/__main__.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/n3dv/extract_videos.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/n3dv/poses_bounds.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/stnerf/__init__.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/utils/__init__.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/utils/colmap.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/utils/ffmpeg.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/utils/rotation.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap/write_model.py +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap.egg-info/dependency_links.txt +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap.egg-info/entry_points.txt +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/nvs2colmap.egg-info/top_level.txt +0 -0
- {nvs2colmap-0.3.0 → nvs2colmap-0.3.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvs2colmap
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Utilities for converting novel view synthesis datasets to COLMAP format.
|
|
5
5
|
Author-email: Howard Yin <yindaheng98@gmail.com>
|
|
6
6
|
Maintainer-email: Howard Yin <yindaheng98@gmail.com>
|
|
@@ -23,6 +23,7 @@ Requires-Python: >=3.10
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: numpy
|
|
26
|
+
Requires-Dist: plyfile
|
|
26
27
|
Requires-Dist: torch
|
|
27
28
|
Dynamic: license-file
|
|
28
29
|
|
|
@@ -60,7 +61,7 @@ Utilities for converting novel view synthesis datasets to COLMAP format.
|
|
|
60
61
|
Install the Python runtime dependencies:
|
|
61
62
|
|
|
62
63
|
```bash
|
|
63
|
-
pip install numpy torch
|
|
64
|
+
pip install numpy plyfile torch
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
For Neural 3D Video scenes, the command also needs `ffmpeg` and `ffprobe` on
|
|
@@ -32,7 +32,7 @@ Utilities for converting novel view synthesis datasets to COLMAP format.
|
|
|
32
32
|
Install the Python runtime dependencies:
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
pip install numpy torch
|
|
35
|
+
pip install numpy plyfile torch
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
For Neural 3D Video scenes, the command also needs `ffmpeg` and `ffprobe` on
|
|
@@ -10,6 +10,7 @@ from nvs2colmap.write_model import write_video_colmap_text_model
|
|
|
10
10
|
|
|
11
11
|
from .camera_meta import read_camera_meta
|
|
12
12
|
from .link_frames import count_frame_dirs, link_frames
|
|
13
|
+
from .points import write_init_point_cloud
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def parse_args() -> argparse.Namespace:
|
|
@@ -123,6 +124,13 @@ def main() -> None:
|
|
|
123
124
|
use_gpu=args.colmap_use_gpu,
|
|
124
125
|
)
|
|
125
126
|
|
|
127
|
+
write_init_point_cloud(
|
|
128
|
+
npz_path=folder / "init_pt_cld.npz",
|
|
129
|
+
output_pattern=frame_output_pattern / "sparse" / "0" / "points3D.ply",
|
|
130
|
+
n_frames=n_frames,
|
|
131
|
+
start_number=args.start_number,
|
|
132
|
+
)
|
|
133
|
+
|
|
126
134
|
print(f"Done: {folder}")
|
|
127
135
|
|
|
128
136
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Write Dynamic 3D Gaussians init_pt_cld.npz as COLMAP points3D.ply."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
import numpy as np
|
|
8
|
+
|
|
9
|
+
from nvs2colmap.write_pcd import write_pcd
|
|
10
|
+
|
|
11
|
+
from .link_frames import link_file
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def write_init_point_cloud(
|
|
15
|
+
npz_path: Path,
|
|
16
|
+
output_pattern: Path,
|
|
17
|
+
n_frames: int,
|
|
18
|
+
start_number: int = 1,
|
|
19
|
+
) -> None:
|
|
20
|
+
data = np.load(npz_path)["data"]
|
|
21
|
+
output_pattern = str(output_pattern)
|
|
22
|
+
paths = [Path(output_pattern % frame) for frame in range(start_number, start_number + n_frames)]
|
|
23
|
+
write_pcd(paths[0], data[:, :3], data[:, 3:6])
|
|
24
|
+
for path in paths[1:]:
|
|
25
|
+
link_file(paths[0], path)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""Write xyz/rgb point clouds as PLY files."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import numpy as np
|
|
6
|
+
from plyfile import PlyData, PlyElement
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def write_pcd(path, points, colors) -> None:
|
|
10
|
+
"""Write a point cloud in the InstantSplat ``points3D.ply`` layout.
|
|
11
|
+
|
|
12
|
+
``points`` and ``colors`` are ``(N, 3)`` arrays. Colors are in ``[0, 1]``
|
|
13
|
+
and are scaled to 8-bit RGB here, matching
|
|
14
|
+
``InitializedPointCloud.save_ply``.
|
|
15
|
+
"""
|
|
16
|
+
xyz = np.asarray(points)
|
|
17
|
+
rgb = np.asarray(colors) * 255.0
|
|
18
|
+
dtype = [
|
|
19
|
+
("x", "f4"),
|
|
20
|
+
("y", "f4"),
|
|
21
|
+
("z", "f4"),
|
|
22
|
+
("nx", "f4"),
|
|
23
|
+
("ny", "f4"),
|
|
24
|
+
("nz", "f4"),
|
|
25
|
+
("red", "u1"),
|
|
26
|
+
("green", "u1"),
|
|
27
|
+
("blue", "u1"),
|
|
28
|
+
]
|
|
29
|
+
normals = np.zeros_like(xyz)
|
|
30
|
+
elements = np.empty(xyz.shape[0], dtype=dtype)
|
|
31
|
+
attributes = np.concatenate((xyz, normals, rgb), axis=1)
|
|
32
|
+
elements[:] = list(map(tuple, attributes))
|
|
33
|
+
|
|
34
|
+
path = Path(path)
|
|
35
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
36
|
+
PlyData([PlyElement.describe(elements, "vertex")]).write(path)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nvs2colmap
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Utilities for converting novel view synthesis datasets to COLMAP format.
|
|
5
5
|
Author-email: Howard Yin <yindaheng98@gmail.com>
|
|
6
6
|
Maintainer-email: Howard Yin <yindaheng98@gmail.com>
|
|
@@ -23,6 +23,7 @@ Requires-Python: >=3.10
|
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
24
24
|
License-File: LICENSE
|
|
25
25
|
Requires-Dist: numpy
|
|
26
|
+
Requires-Dist: plyfile
|
|
26
27
|
Requires-Dist: torch
|
|
27
28
|
Dynamic: license-file
|
|
28
29
|
|
|
@@ -60,7 +61,7 @@ Utilities for converting novel view synthesis datasets to COLMAP format.
|
|
|
60
61
|
Install the Python runtime dependencies:
|
|
61
62
|
|
|
62
63
|
```bash
|
|
63
|
-
pip install numpy torch
|
|
64
|
+
pip install numpy plyfile torch
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
For Neural 3D Video scenes, the command also needs `ffmpeg` and `ffprobe` on
|
|
@@ -5,9 +5,11 @@ pyproject.toml
|
|
|
5
5
|
./nvs2colmap/colmap.py
|
|
6
6
|
./nvs2colmap/extract_videos.py
|
|
7
7
|
./nvs2colmap/write_model.py
|
|
8
|
+
./nvs2colmap/write_pcd.py
|
|
8
9
|
./nvs2colmap/dynamic3dgs/__main__.py
|
|
9
10
|
./nvs2colmap/dynamic3dgs/camera_meta.py
|
|
10
11
|
./nvs2colmap/dynamic3dgs/link_frames.py
|
|
12
|
+
./nvs2colmap/dynamic3dgs/points.py
|
|
11
13
|
./nvs2colmap/n3dv/__main__.py
|
|
12
14
|
./nvs2colmap/n3dv/extract_videos.py
|
|
13
15
|
./nvs2colmap/n3dv/poses_bounds.py
|
|
@@ -20,6 +22,7 @@ nvs2colmap/__init__.py
|
|
|
20
22
|
nvs2colmap/colmap.py
|
|
21
23
|
nvs2colmap/extract_videos.py
|
|
22
24
|
nvs2colmap/write_model.py
|
|
25
|
+
nvs2colmap/write_pcd.py
|
|
23
26
|
nvs2colmap.egg-info/PKG-INFO
|
|
24
27
|
nvs2colmap.egg-info/SOURCES.txt
|
|
25
28
|
nvs2colmap.egg-info/dependency_links.txt
|
|
@@ -29,6 +32,7 @@ nvs2colmap.egg-info/top_level.txt
|
|
|
29
32
|
nvs2colmap/dynamic3dgs/__main__.py
|
|
30
33
|
nvs2colmap/dynamic3dgs/camera_meta.py
|
|
31
34
|
nvs2colmap/dynamic3dgs/link_frames.py
|
|
35
|
+
nvs2colmap/dynamic3dgs/points.py
|
|
32
36
|
nvs2colmap/n3dv/__main__.py
|
|
33
37
|
nvs2colmap/n3dv/extract_videos.py
|
|
34
38
|
nvs2colmap/n3dv/poses_bounds.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nvs2colmap"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "Utilities for converting novel view synthesis datasets to COLMAP format."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Howard Yin", email = "yindaheng98@gmail.com" }]
|
|
@@ -12,6 +12,7 @@ maintainers = [{ name = "Howard Yin", email = "yindaheng98@gmail.com" }]
|
|
|
12
12
|
requires-python = ">=3.10"
|
|
13
13
|
dependencies = [
|
|
14
14
|
"numpy",
|
|
15
|
+
"plyfile",
|
|
15
16
|
"torch",
|
|
16
17
|
]
|
|
17
18
|
keywords = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|