nvs2colmap 0.3.2__tar.gz → 0.4.0__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.
Files changed (28) hide show
  1. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/PKG-INFO +22 -12
  2. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/README.md +21 -11
  3. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/colmap.py +0 -5
  4. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/dynamic3dgs/__main__.py +8 -9
  5. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/n3dv/__main__.py +2 -2
  6. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/utils/__init__.py +0 -2
  7. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/utils/colmap.py +0 -12
  8. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap.egg-info/PKG-INFO +22 -12
  9. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/pyproject.toml +1 -1
  10. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/LICENSE +0 -0
  11. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/__init__.py +0 -0
  12. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/dynamic3dgs/camera_meta.py +0 -0
  13. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/dynamic3dgs/link_frames.py +0 -0
  14. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/dynamic3dgs/points.py +0 -0
  15. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/extract_videos.py +0 -0
  16. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/n3dv/extract_videos.py +0 -0
  17. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/n3dv/poses_bounds.py +0 -0
  18. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/stnerf/__init__.py +0 -0
  19. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/utils/ffmpeg.py +0 -0
  20. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/utils/rotation.py +0 -0
  21. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/write_model.py +0 -0
  22. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap/write_pcd.py +0 -0
  23. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap.egg-info/SOURCES.txt +0 -0
  24. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap.egg-info/dependency_links.txt +0 -0
  25. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap.egg-info/entry_points.txt +0 -0
  26. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap.egg-info/requires.txt +0 -0
  27. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/nvs2colmap.egg-info/top_level.txt +0 -0
  28. {nvs2colmap-0.3.2 → nvs2colmap-0.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nvs2colmap
3
- Version: 0.3.2
3
+ Version: 0.4.0
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>
@@ -31,6 +31,8 @@ Dynamic: license-file
31
31
 
32
32
  Utilities for converting novel view synthesis datasets to COLMAP format.
33
33
 
34
+ **These scenes are prepared for [InstantSplat](https://github.com/yindaheng98/InstantSplat). The default commands write known-pose `sparse/0` text models and do not call COLMAP. `--use-colmap` runs feature extraction, matching, triangulation, and mapping, then stops at `distorted/sparse/0`. InstantSplat undistorts images and masks together with `image_undistorter` and `mask_undistorter`. This repository does not undistort, because `image_undistorter` alone leaves masks untouched.**
35
+
34
36
  ## Supported Formats
35
37
 
36
38
  - **Neural 3D Video Dataset**: scenes with `poses_bounds.npy` and one `mp4`
@@ -65,11 +67,13 @@ pip install numpy plyfile torch
65
67
  ```
66
68
 
67
69
  For Neural 3D Video scenes, the command also needs `ffmpeg` and `ffprobe` on
68
- `PATH`, or explicit paths via `--ffmpeg` and `--ffprobe`. If you want to run
69
- the full COLMAP pipeline, also provide a COLMAP executable via
70
- `--colmap-executable`.
70
+ `PATH`, or explicit paths via `--ffmpeg` and `--ffprobe`. To run the COLMAP
71
+ reconstruction that
72
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) continues from,
73
+ also provide a COLMAP executable via `--colmap-executable`.
71
74
 
72
- Extract a Neural 3D Video scene and write per-frame COLMAP text models:
75
+ Extract a Neural 3D Video scene and write per-frame COLMAP text models for
76
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
73
77
 
74
78
  ```bash
75
79
  python -m nvs2colmap.n3dv \
@@ -90,7 +94,8 @@ python -m nvs2colmap.n3dv \
90
94
  --n-frames 300
91
95
  ```
92
96
 
93
- Run the full COLMAP pipeline for each frame:
97
+ Run COLMAP reconstruction for each frame, leaving undistortion to
98
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
94
99
 
95
100
  ```bash
96
101
  python -m nvs2colmap.n3dv \
@@ -105,7 +110,8 @@ python -m nvs2colmap.n3dv \
105
110
  ```
106
111
 
107
112
  Link a Dynamic 3D Gaussians scene, including its masks, and write per-frame
108
- COLMAP text models:
113
+ COLMAP text models for
114
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
109
115
 
110
116
  ```bash
111
117
  python -m nvs2colmap.dynamic3dgs \
@@ -116,16 +122,20 @@ python -m nvs2colmap.dynamic3dgs \
116
122
  For Neural 3D Video scenes, decoded frames are written to `frame*/images` by
117
123
  default, and the command also writes `frame*/sparse/0` text models. With
118
124
  `--use-colmap`, decoded frames are written to `frame*/input`, and each frame
119
- additionally gets the standard COLMAP outputs such as `distorted/`, `images/`,
120
- `sparse/`, and `stereo/`. When `--start-number N` is provided, decoding starts
121
- from source video frame `N`, and the generated folders/images are also numbered
122
- from `N`.
125
+ additionally gets the COLMAP workspace under `distorted/`, including
126
+ `distorted/sparse/0`.
127
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) undistorts that
128
+ workspace. When `--start-number N` is provided, decoding starts from source
129
+ video frame `N`, and the generated folders/images are also numbered from `N`.
123
130
 
124
131
  For Dynamic 3D Gaussians scenes, images from both `train_meta.json` and
125
132
  `test_meta.json` are hardlinked into `frame*/images`, and included masks are
126
133
  hardlinked into `frame*/image_masks` (`cam01.jpg` pairs with `cam01.jpg.png`).
127
134
  `--no-train-camera` and `--no-test-camera` drop one split. The same
128
135
  `--use-colmap` switch writes images to `frame*/input`, masks to
129
- `frame*/input_mask`, and runs COLMAP.
136
+ `frame*/input_mask`, and runs COLMAP through mapping.
137
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) undistorts both.
138
+ That switch does not write `init_pt_cld.npz` into `sparse/0/points3D.ply`;
139
+ the reconstructed points stay in `distorted/sparse/0`.
130
140
  `--start-number` uses the same 1-based output numbering; source file
131
141
  `000000.jpg` is frame `1`.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Utilities for converting novel view synthesis datasets to COLMAP format.
4
4
 
5
+ **These scenes are prepared for [InstantSplat](https://github.com/yindaheng98/InstantSplat). The default commands write known-pose `sparse/0` text models and do not call COLMAP. `--use-colmap` runs feature extraction, matching, triangulation, and mapping, then stops at `distorted/sparse/0`. InstantSplat undistorts images and masks together with `image_undistorter` and `mask_undistorter`. This repository does not undistort, because `image_undistorter` alone leaves masks untouched.**
6
+
5
7
  ## Supported Formats
6
8
 
7
9
  - **Neural 3D Video Dataset**: scenes with `poses_bounds.npy` and one `mp4`
@@ -36,11 +38,13 @@ pip install numpy plyfile torch
36
38
  ```
37
39
 
38
40
  For Neural 3D Video scenes, the command also needs `ffmpeg` and `ffprobe` on
39
- `PATH`, or explicit paths via `--ffmpeg` and `--ffprobe`. If you want to run
40
- the full COLMAP pipeline, also provide a COLMAP executable via
41
- `--colmap-executable`.
41
+ `PATH`, or explicit paths via `--ffmpeg` and `--ffprobe`. To run the COLMAP
42
+ reconstruction that
43
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) continues from,
44
+ also provide a COLMAP executable via `--colmap-executable`.
42
45
 
43
- Extract a Neural 3D Video scene and write per-frame COLMAP text models:
46
+ Extract a Neural 3D Video scene and write per-frame COLMAP text models for
47
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
44
48
 
45
49
  ```bash
46
50
  python -m nvs2colmap.n3dv \
@@ -61,7 +65,8 @@ python -m nvs2colmap.n3dv \
61
65
  --n-frames 300
62
66
  ```
63
67
 
64
- Run the full COLMAP pipeline for each frame:
68
+ Run COLMAP reconstruction for each frame, leaving undistortion to
69
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
65
70
 
66
71
  ```bash
67
72
  python -m nvs2colmap.n3dv \
@@ -76,7 +81,8 @@ python -m nvs2colmap.n3dv \
76
81
  ```
77
82
 
78
83
  Link a Dynamic 3D Gaussians scene, including its masks, and write per-frame
79
- COLMAP text models:
84
+ COLMAP text models for
85
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
80
86
 
81
87
  ```bash
82
88
  python -m nvs2colmap.dynamic3dgs \
@@ -87,16 +93,20 @@ python -m nvs2colmap.dynamic3dgs \
87
93
  For Neural 3D Video scenes, decoded frames are written to `frame*/images` by
88
94
  default, and the command also writes `frame*/sparse/0` text models. With
89
95
  `--use-colmap`, decoded frames are written to `frame*/input`, and each frame
90
- additionally gets the standard COLMAP outputs such as `distorted/`, `images/`,
91
- `sparse/`, and `stereo/`. When `--start-number N` is provided, decoding starts
92
- from source video frame `N`, and the generated folders/images are also numbered
93
- from `N`.
96
+ additionally gets the COLMAP workspace under `distorted/`, including
97
+ `distorted/sparse/0`.
98
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) undistorts that
99
+ workspace. When `--start-number N` is provided, decoding starts from source
100
+ video frame `N`, and the generated folders/images are also numbered from `N`.
94
101
 
95
102
  For Dynamic 3D Gaussians scenes, images from both `train_meta.json` and
96
103
  `test_meta.json` are hardlinked into `frame*/images`, and included masks are
97
104
  hardlinked into `frame*/image_masks` (`cam01.jpg` pairs with `cam01.jpg.png`).
98
105
  `--no-train-camera` and `--no-test-camera` drop one split. The same
99
106
  `--use-colmap` switch writes images to `frame*/input`, masks to
100
- `frame*/input_mask`, and runs COLMAP.
107
+ `frame*/input_mask`, and runs COLMAP through mapping.
108
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) undistorts both.
109
+ That switch does not write `init_pt_cld.npz` into `sparse/0/points3D.ply`;
110
+ the reconstructed points stay in `distorted/sparse/0`.
101
111
  `--start-number` uses the same 1-based output numbering; source file
102
112
  `000000.jpg` is frame `1`.
@@ -10,7 +10,6 @@ from nvs2colmap.write_model import CameraModel
10
10
  from nvs2colmap.utils.colmap import (
11
11
  exhaustive_matcher,
12
12
  feature_extractor,
13
- image_undistorter,
14
13
  mapper,
15
14
  point_triangulator,
16
15
  read_db,
@@ -65,10 +64,6 @@ def run_colmap(
65
64
  if mapper(str(folder), str(mapper_input_path), colmap_executable=colmap_executable) != 0:
66
65
  raise RuntimeError("Mapping failed")
67
66
 
68
- # To fit sparse init in instantsplat
69
- if image_undistorter(str(folder), colmap_executable=colmap_executable) != 0:
70
- raise RuntimeError("Image undistortion failed")
71
-
72
67
 
73
68
  def run_video_colmap(
74
69
  output_pattern: Path,
@@ -56,8 +56,8 @@ def parse_args() -> argparse.Namespace:
56
56
  "--use-colmap",
57
57
  action="store_true",
58
58
  help=(
59
- "Run COLMAP feature extraction, matching, triangulation, mapping, "
60
- "and undistortion instead of only writing sparse/0 text models."
59
+ "Run COLMAP feature extraction, matching, triangulation, and mapping "
60
+ "instead of only writing sparse/0 text models."
61
61
  ),
62
62
  )
63
63
  parser.add_argument(
@@ -115,6 +115,12 @@ def main() -> None:
115
115
  start_number=args.start_number,
116
116
  image_extension="",
117
117
  )
118
+ write_init_point_cloud(
119
+ npz_path=folder / "init_pt_cld.npz",
120
+ output_pattern=frame_output_pattern / "sparse" / "0" / "points3D.ply",
121
+ n_frames=n_frames,
122
+ start_number=args.start_number,
123
+ )
118
124
  else:
119
125
  run_video_colmap(
120
126
  output_pattern=frame_output_pattern,
@@ -126,13 +132,6 @@ def main() -> None:
126
132
  use_gpu=args.colmap_use_gpu,
127
133
  )
128
134
 
129
- write_init_point_cloud(
130
- npz_path=folder / "init_pt_cld.npz",
131
- output_pattern=frame_output_pattern / "sparse" / "0" / "points3D.ply",
132
- n_frames=n_frames,
133
- start_number=args.start_number,
134
- )
135
-
136
135
  print(f"Done: {folder}")
137
136
 
138
137
 
@@ -73,8 +73,8 @@ def parse_args() -> argparse.Namespace:
73
73
  "--use-colmap",
74
74
  action="store_true",
75
75
  help=(
76
- "Run COLMAP feature extraction, matching, triangulation, mapping, "
77
- "and undistortion instead of only writing sparse/0 text models."
76
+ "Run COLMAP feature extraction, matching, triangulation, and mapping "
77
+ "instead of only writing sparse/0 text models."
78
78
  ),
79
79
  )
80
80
  parser.add_argument(
@@ -4,7 +4,6 @@ from .colmap import (
4
4
  execute,
5
5
  exhaustive_matcher,
6
6
  feature_extractor,
7
- image_undistorter,
8
7
  mapper,
9
8
  model_converter_bin,
10
9
  model_converter_txt,
@@ -21,7 +20,6 @@ __all__ = [
21
20
  "extract_video_frames",
22
21
  "extract_video_frames_parallel",
23
22
  "feature_extractor",
24
- "image_undistorter",
25
23
  "mapper",
26
24
  "matrix_to_quaternion",
27
25
  "model_converter_bin",
@@ -62,7 +62,6 @@ def mapper(folder, mapper_input_path, colmap_executable="colmap"):
62
62
  colmap_executable, "mapper",
63
63
  "--database_path", os.path.join(folder, "distorted", "database.db"),
64
64
  "--image_path", os.path.join(folder, "input"),
65
- "--Mapper.ba_global_function_tolerance=0.000001",
66
65
  "--input_path", mapper_input_path,
67
66
  "--output_path", os.path.join(folder, "distorted", "sparse", "0")
68
67
  ]
@@ -91,14 +90,3 @@ def model_converter_bin(folder, colmap_executable="colmap"):
91
90
  "--output_type=BIN",
92
91
  ]
93
92
  return execute(cmd)
94
-
95
-
96
- def image_undistorter(folder, colmap_executable="colmap"):
97
- cmd = [
98
- colmap_executable, "image_undistorter",
99
- "--image_path", os.path.join(folder, "input"),
100
- "--input_path", os.path.join(folder, "distorted", "sparse", "0"),
101
- "--output_path", folder,
102
- "--output_type=COLMAP",
103
- ]
104
- return execute(cmd)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nvs2colmap
3
- Version: 0.3.2
3
+ Version: 0.4.0
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>
@@ -31,6 +31,8 @@ Dynamic: license-file
31
31
 
32
32
  Utilities for converting novel view synthesis datasets to COLMAP format.
33
33
 
34
+ **These scenes are prepared for [InstantSplat](https://github.com/yindaheng98/InstantSplat). The default commands write known-pose `sparse/0` text models and do not call COLMAP. `--use-colmap` runs feature extraction, matching, triangulation, and mapping, then stops at `distorted/sparse/0`. InstantSplat undistorts images and masks together with `image_undistorter` and `mask_undistorter`. This repository does not undistort, because `image_undistorter` alone leaves masks untouched.**
35
+
34
36
  ## Supported Formats
35
37
 
36
38
  - **Neural 3D Video Dataset**: scenes with `poses_bounds.npy` and one `mp4`
@@ -65,11 +67,13 @@ pip install numpy plyfile torch
65
67
  ```
66
68
 
67
69
  For Neural 3D Video scenes, the command also needs `ffmpeg` and `ffprobe` on
68
- `PATH`, or explicit paths via `--ffmpeg` and `--ffprobe`. If you want to run
69
- the full COLMAP pipeline, also provide a COLMAP executable via
70
- `--colmap-executable`.
70
+ `PATH`, or explicit paths via `--ffmpeg` and `--ffprobe`. To run the COLMAP
71
+ reconstruction that
72
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) continues from,
73
+ also provide a COLMAP executable via `--colmap-executable`.
71
74
 
72
- Extract a Neural 3D Video scene and write per-frame COLMAP text models:
75
+ Extract a Neural 3D Video scene and write per-frame COLMAP text models for
76
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
73
77
 
74
78
  ```bash
75
79
  python -m nvs2colmap.n3dv \
@@ -90,7 +94,8 @@ python -m nvs2colmap.n3dv \
90
94
  --n-frames 300
91
95
  ```
92
96
 
93
- Run the full COLMAP pipeline for each frame:
97
+ Run COLMAP reconstruction for each frame, leaving undistortion to
98
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
94
99
 
95
100
  ```bash
96
101
  python -m nvs2colmap.n3dv \
@@ -105,7 +110,8 @@ python -m nvs2colmap.n3dv \
105
110
  ```
106
111
 
107
112
  Link a Dynamic 3D Gaussians scene, including its masks, and write per-frame
108
- COLMAP text models:
113
+ COLMAP text models for
114
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat):
109
115
 
110
116
  ```bash
111
117
  python -m nvs2colmap.dynamic3dgs \
@@ -116,16 +122,20 @@ python -m nvs2colmap.dynamic3dgs \
116
122
  For Neural 3D Video scenes, decoded frames are written to `frame*/images` by
117
123
  default, and the command also writes `frame*/sparse/0` text models. With
118
124
  `--use-colmap`, decoded frames are written to `frame*/input`, and each frame
119
- additionally gets the standard COLMAP outputs such as `distorted/`, `images/`,
120
- `sparse/`, and `stereo/`. When `--start-number N` is provided, decoding starts
121
- from source video frame `N`, and the generated folders/images are also numbered
122
- from `N`.
125
+ additionally gets the COLMAP workspace under `distorted/`, including
126
+ `distorted/sparse/0`.
127
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) undistorts that
128
+ workspace. When `--start-number N` is provided, decoding starts from source
129
+ video frame `N`, and the generated folders/images are also numbered from `N`.
123
130
 
124
131
  For Dynamic 3D Gaussians scenes, images from both `train_meta.json` and
125
132
  `test_meta.json` are hardlinked into `frame*/images`, and included masks are
126
133
  hardlinked into `frame*/image_masks` (`cam01.jpg` pairs with `cam01.jpg.png`).
127
134
  `--no-train-camera` and `--no-test-camera` drop one split. The same
128
135
  `--use-colmap` switch writes images to `frame*/input`, masks to
129
- `frame*/input_mask`, and runs COLMAP.
136
+ `frame*/input_mask`, and runs COLMAP through mapping.
137
+ [InstantSplat](https://github.com/yindaheng98/InstantSplat) undistorts both.
138
+ That switch does not write `init_pt_cld.npz` into `sparse/0/points3D.ply`;
139
+ the reconstructed points stay in `distorted/sparse/0`.
130
140
  `--start-number` uses the same 1-based output numbering; source file
131
141
  `000000.jpg` is frame `1`.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "nvs2colmap"
7
- version = "0.3.2"
7
+ version = "0.4.0"
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" }]
File without changes
File without changes