17
17
18
18
import sys
19
19
from dataclasses import dataclass , field
20
- from pathlib import Path
21
20
from functools import partial
21
+ from pathlib import Path
22
22
from typing import List , Literal , Optional , Type
23
23
24
24
import numpy as np
31
31
from nerfstudio .data .dataparsers .base_dataparser import DataParser , DataParserConfig , DataparserOutputs
32
32
from nerfstudio .data .scene_box import SceneBox
33
33
from nerfstudio .data .utils import colmap_parsing_utils as colmap_utils
34
- from nerfstudio .process_data .colmap_utils import parse_colmap_camera_params
35
- from nerfstudio .utils .scripts import run_command
36
- from nerfstudio .utils .rich_utils import CONSOLE , status
37
34
from nerfstudio .data .utils .dataparsers_utils import (
35
+ get_train_eval_split_all ,
38
36
get_train_eval_split_filename ,
39
37
get_train_eval_split_fraction ,
40
38
get_train_eval_split_interval ,
41
- get_train_eval_split_all ,
42
39
)
40
+ from nerfstudio .process_data .colmap_utils import parse_colmap_camera_params
41
+ from nerfstudio .utils .rich_utils import CONSOLE , status
42
+ from nerfstudio .utils .scripts import run_command
43
43
44
44
MAX_AUTO_RESOLUTION = 1600
45
45
@@ -66,7 +66,7 @@ class ColmapDataParserConfig(DataParserConfig):
66
66
"""Whether to automatically scale the poses to fit in +/- 1 bounding box."""
67
67
eval_mode : Literal ["fraction" , "filename" , "interval" , "all" ] = "interval"
68
68
"""
69
- The method to use for splitting the dataset into train and eval.
69
+ The method to use for splitting the dataset into train and eval.
70
70
Fraction splits based on a percentage for train and the remaining for eval.
71
71
Filename splits based on filenames containing train/eval.
72
72
Interval uses every nth frame for eval (used by most academic papers, e.g. MipNerf360, GSplat).
@@ -284,15 +284,11 @@ def _generate_dataparser_outputs(self, split: str = "train", **kwargs):
284
284
if "depth_path" in frame :
285
285
depth_filenames .append (Path (frame ["depth_path" ]))
286
286
287
- assert len (mask_filenames ) == 0 or (
288
- len (mask_filenames ) == len (image_filenames )
289
- ), """
287
+ assert len (mask_filenames ) == 0 or (len (mask_filenames ) == len (image_filenames )), """
290
288
Different number of image and mask filenames.
291
289
You should check that mask_path is specified for every frame (or zero frames) in transforms.json.
292
290
"""
293
- assert len (depth_filenames ) == 0 or (
294
- len (depth_filenames ) == len (image_filenames )
295
- ), """
291
+ assert len (depth_filenames ) == 0 or (len (depth_filenames ) == len (image_filenames )), """
296
292
Different number of image and depth filenames.
297
293
You should check that depth_file_path is specified for every frame (or zero frames) in transforms.json.
298
294
"""
0 commit comments