From e0ad53762e1e7cb56cedd37828b328855caad897 Mon Sep 17 00:00:00 2001 From: Jingchen Ye <11172084+97littleleaf11@users.noreply.github.com> Date: Sat, 25 Feb 2023 03:16:37 +0800 Subject: [PATCH] Rename train_split_percentage with train_split_fraction (#1497) rename train_split_percentage with train_split_fraction --- docs/developer_guides/pipelines/dataparsers.md | 4 ++-- nerfstudio/data/dataparsers/nerfstudio_dataparser.py | 6 +++--- nerfstudio/data/dataparsers/nuscenes_dataparser.py | 4 ++-- nerfstudio/data/dataparsers/phototourism_dataparser.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/developer_guides/pipelines/dataparsers.md b/docs/developer_guides/pipelines/dataparsers.md index 40ef7f4fd..6b81803c2 100644 --- a/docs/developer_guides/pipelines/dataparsers.md +++ b/docs/developer_guides/pipelines/dataparsers.md @@ -69,8 +69,8 @@ class NerfstudioDataParserConfig(DataParserConfig): """How much to scale the region of interest by.""" orientation_method: Literal["pca", "up"] = "up" """The method to use for orientation.""" - train_split_percentage: float = 0.9 - """The percent of images to use for training. The remaining images are for eval.""" + train_split_fraction: float = 0.9 + """The fraction of images to use for training. The remaining images are for eval.""" @dataclass class Nerfstudio(DataParser): diff --git a/nerfstudio/data/dataparsers/nerfstudio_dataparser.py b/nerfstudio/data/dataparsers/nerfstudio_dataparser.py index 0980a62ac..fd0d49830 100644 --- a/nerfstudio/data/dataparsers/nerfstudio_dataparser.py +++ b/nerfstudio/data/dataparsers/nerfstudio_dataparser.py @@ -60,8 +60,8 @@ class NerfstudioDataParserConfig(DataParserConfig): """Whether to center the poses.""" auto_scale_poses: bool = True """Whether to automatically scale the poses to fit in +/- 1 bounding box.""" - train_split_percentage: float = 0.9 - """The percent of images to use for training. The remaining images are for eval.""" + train_split_fraction: float = 0.9 + """The fraction of images to use for training. The remaining images are for eval.""" depth_unit_scale_factor: float = 1e-3 """Scales the depth values to meters. Default value is 0.001 for a millimeter to meter conversion.""" @@ -184,7 +184,7 @@ class Nerfstudio(DataParser): # filter image_filenames and poses based on train/eval split percentage num_images = len(image_filenames) - num_train_images = math.ceil(num_images * self.config.train_split_percentage) + num_train_images = math.ceil(num_images * self.config.train_split_fraction) num_eval_images = num_images - num_train_images i_all = np.arange(num_images) i_train = np.linspace( diff --git a/nerfstudio/data/dataparsers/nuscenes_dataparser.py b/nerfstudio/data/dataparsers/nuscenes_dataparser.py index 9269f555f..e74b59acd 100644 --- a/nerfstudio/data/dataparsers/nuscenes_dataparser.py +++ b/nerfstudio/data/dataparsers/nuscenes_dataparser.py @@ -66,7 +66,7 @@ class NuScenesDataParserConfig(DataParserConfig): mask_dir: Optional[Path] = None """Path to masks of dynamic objects.""" - train_split_percentage: float = 0.9 + train_split_fraction: float = 0.9 """The percent of images to use for training. The remaining images are for eval.""" verbose: bool = False @@ -160,7 +160,7 @@ class NuScenes(DataParser): # filter image_filenames and poses based on train/eval split percentage num_snapshots = len(samples) - num_train_snapshots = math.ceil(num_snapshots * self.config.train_split_percentage) + num_train_snapshots = math.ceil(num_snapshots * self.config.train_split_fraction) num_eval_snapshots = num_snapshots - num_train_snapshots i_all = np.arange(num_snapshots) i_train = np.linspace( diff --git a/nerfstudio/data/dataparsers/phototourism_dataparser.py b/nerfstudio/data/dataparsers/phototourism_dataparser.py index bb401d9dc..5af4518fc 100644 --- a/nerfstudio/data/dataparsers/phototourism_dataparser.py +++ b/nerfstudio/data/dataparsers/phototourism_dataparser.py @@ -50,8 +50,8 @@ class PhototourismDataParserConfig(DataParserConfig): """How much to scale the camera origins by.""" alpha_color: str = "white" """alpha color of background""" - train_split_percentage: float = 0.9 - """The percent of images to use for training. The remaining images are for eval.""" + train_split_fraction: float = 0.9 + """The fraction of images to use for training. The remaining images are for eval.""" scene_scale: float = 1.0 """How much to scale the region of interest by.""" orientation_method: Literal["pca", "up", "none"] = "up" @@ -119,7 +119,7 @@ class Phototourism(DataParser): # filter image_filenames and poses based on train/eval split percentage num_images = len(image_filenames) - num_train_images = math.ceil(num_images * self.config.train_split_percentage) + num_train_images = math.ceil(num_images * self.config.train_split_fraction) num_eval_images = num_images - num_train_images i_all = np.arange(num_images) i_train = np.linspace(