Refactor of image and video dataset conversion (#1690)

* Refactor of image and video dataset conversion

The classes to convert images and video to a NerfStudio
dataset are moved to the main repo and refactor:
* Code duplications are removed
* Import of the class is now done from nerfstudio package instead of
  scripts

* Doc formatting nits

* Doc formatting

---------

Co-authored-by: Brent Yi <yibrenth@gmail.com>
This commit is contained in:
Malcolm MielleandBrent Yi authored and GitHub committed 2023-04-26 10:30:01 -07:00
1 parent 281615e638
commit 3d2e62a480
6 files changed
+544 -490

No files matched your search

+7 -3
View File
@@ -16,7 +16,9 @@ from nerfstudio.data.utils.colmap_parsing_utils import (
write_cameras_binary,
write_images_binary,
)
from scripts.process_data import ProcessImages
from nerfstudio.process_data.images_to_nerstudio_dataset import (
ImagesToNerfstudioDataset,
)
def random_quaternion(num_poses: int):
@@ -79,8 +81,10 @@ def test_process_images_skip_colmap(tmp_path: Path):
(tmp_path / "mocked_bin" / "colmap").touch(mode=0o777)
(tmp_path / "mocked_bin" / "ffmpeg").touch(mode=0o777)
# Run ProcessImages
cmd = ProcessImages(tmp_path / "images", tmp_path / "nerfstudio", colmap_model_path=sparse_path, skip_colmap=True)
# Convert images into a NerfStudio dataset
cmd = ImagesToNerfstudioDataset(
data=tmp_path / "images", output_dir=tmp_path / "nerfstudio", colmap_model_path=sparse_path, skip_colmap=True
)
cmd.main()
os.environ["PATH"] = old_path