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