mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-13 03:14:00 +08:00
Bug fixes with Record3D and new config system. (#336)
fixed some bugs regarding record3d and new config system.
This commit is contained in:
1 parent
6f3518d54f
commit
18f8a5d0b8
2 files changed
+8
-5
No files matched your search
@@ -31,6 +31,7 @@ from nerfactory.dataloaders.data_parsers import (
|
||||
Friends,
|
||||
InstantNGP,
|
||||
Mipnerf360,
|
||||
Record3D,
|
||||
)
|
||||
from nerfactory.models.base import Model
|
||||
from nerfactory.models.instant_ngp import NGPModel
|
||||
@@ -214,7 +215,7 @@ class InstantNGPDataParserConfig(DataParserConfig):
|
||||
class Record3DDataParserConfig(DataParserConfig):
|
||||
"""Mipnerf 360 dataset config"""
|
||||
|
||||
_target: Type = Mipnerf360
|
||||
_target: Type = Record3D
|
||||
data_directory: Path = Path("data/record3d/garden")
|
||||
downscale_factor: int = 1
|
||||
val_skip: int = 8
|
||||
@@ -385,6 +386,7 @@ class Config(PrintableConfig):
|
||||
"""Convert logging directories to more specific filepaths"""
|
||||
dt_str = datetime.now().strftime("%Y-%m-%d_%H%M%S")
|
||||
self.base_dir = Path(f"outputs/{self.experiment_name}/{self.method_name}/{dt_str}")
|
||||
self.trainer.model_dir = self.base_dir / self.trainer.relative_model_dir
|
||||
if self.trainer.model_dir is None:
|
||||
self.trainer.model_dir = self.base_dir / self.trainer.relative_model_dir
|
||||
for curr_writer in self.logging.writer:
|
||||
curr_writer.log_dir = self.base_dir / curr_writer.relative_log_dir
|
||||
@@ -434,11 +434,12 @@ class Record3D(DataParser):
|
||||
if not image_dir.exists():
|
||||
raise ValueError(f"Image directory {image_dir} doesn't exist")
|
||||
|
||||
ext = ".jpg"
|
||||
image_filenames = []
|
||||
for f in image_dir.iterdir():
|
||||
image_filenames.append(image_dir / f)
|
||||
image_filenames = sorted(image_filenames, key=lambda fn: int(fn.name[: -len(ext)]))
|
||||
if f.stem.isdigit(): # removes possible duplicate images (for example, 123(3).jpg)
|
||||
image_filenames.append(image_dir / f)
|
||||
|
||||
image_filenames = sorted(image_filenames, key=lambda fn: int(fn.stem))
|
||||
image_filenames = np.array(image_filenames)
|
||||
num_images = len(image_filenames)
|
||||
|
||||
|
||||
Reference in new issue
Block a user