mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-27 03:20:34 +08:00
Terrance/nerfactory data windows fix (#564)
* reverting changes * reverting change * adding pylint ignore
This commit is contained in:
1 parent
1f484661f2
commit
8af3a7a385
1 file changed
+9
-6
@@ -18,7 +18,7 @@ from __future__ import annotations
|
|||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from pathlib import Path
|
from pathlib import Path, PureWindowsPath
|
||||||
from typing import Literal, Type
|
from typing import Literal, Type
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@@ -59,7 +59,7 @@ class Nerfactory(DataParser):
|
|||||||
config: NerfactoryDataParserConfig
|
config: NerfactoryDataParserConfig
|
||||||
|
|
||||||
def _generate_dataset_inputs(self, split="train"):
|
def _generate_dataset_inputs(self, split="train"):
|
||||||
|
# pylint: disable=too-many-statements
|
||||||
abs_dir = get_absolute_path(self.config.data_directory)
|
abs_dir = get_absolute_path(self.config.data_directory)
|
||||||
|
|
||||||
meta = load_from_json(abs_dir / "transforms.json")
|
meta = load_from_json(abs_dir / "transforms.json")
|
||||||
@@ -67,11 +67,14 @@ class Nerfactory(DataParser):
|
|||||||
poses = []
|
poses = []
|
||||||
num_skipped_image_filenames = 0
|
num_skipped_image_filenames = 0
|
||||||
for frame in meta["frames"]:
|
for frame in meta["frames"]:
|
||||||
fname = abs_dir / Path(frame["file_path"])
|
if "\\" in frame["file_path"]:
|
||||||
if self.config.downscale_factor > 1:
|
filepath = PureWindowsPath(frame["file_path"])
|
||||||
fname = abs_dir / f"images_{self.config.downscale_factor}" / Path(frame["file_path"]).name
|
|
||||||
else:
|
else:
|
||||||
fname = abs_dir / Path(frame["file_path"])
|
filepath = Path(frame["file_path"])
|
||||||
|
if self.config.downscale_factor > 1:
|
||||||
|
fname = abs_dir / f"images_{self.config.downscale_factor}" / filepath.name
|
||||||
|
else:
|
||||||
|
fname = abs_dir / filepath
|
||||||
if not fname:
|
if not fname:
|
||||||
num_skipped_image_filenames += 1
|
num_skipped_image_filenames += 1
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in new issue
Block a user