Tancik/lint and format scripts (#140)

* Lint and formatter to include scripts folder
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-07-14 11:12:23 -07:00
1 parent 0b246d6978
commit e0fb77bf1a
7 files changed
+32 -13

No files matched your search

+13 -3
View File
@@ -4,8 +4,8 @@ Script to process different dataset types into our format.
# TODO(ethan): we should write a script here to convert from other datasets to our formats
# e.g., Blender, LLFF, ShapeNet, DTU
from typing import List
from hydra import compose, initialize
import json
from pyrad.data.utils import get_dataset_inputs
from pyrad.utils.io import get_absolute_path, make_dir, write_to_pkl
@@ -13,10 +13,20 @@ from pyrad.utils.misc import get_hash_str_from_dict
def save_dataset_inputs_to_cache(
dataset_name="friends_TBBT-big_living_room", splits=["train", "val", "test"], downscale_factors=[1, 2, 4]
dataset_name: str = "friends_TBBT-big_living_room", splits: List = None, downscale_factors: List = None
):
"""Save the datasets input to cache.
TODO(ethan): use a serializable representation that's cleaner instead of pickle."""
TODO(ethan): use a serializable representation that's cleaner instead of pickle.
Args:
dataset_name (str): name of the dataset
splits (List[str]): list of splits to save. Defaults to ["train", "val", "test"]
downscale_factors (List[int]): list of downscale factors to save. Defaults to [1, 2, 4]
"""
if splits is None:
splits = ["train", "val", "test"]
if downscale_factors is None:
downscale_factors = [1, 2, 4]
with initialize(version_base="1.2", config_path="../configs"):
config = compose(config_name="default_setup.yaml", overrides=[f"data/dataset={dataset_name}"])
for downscale_factor in downscale_factors: