integrating record3d and fix checkpoint delete issue (#722)

* integrating record3d

* fix save checkpoint logic

* added record3d data
This commit is contained in:
Ethan Weber authored and GitHub committed 2022-10-07 00:34:51 -07:00
1 parent fe5f7ea97d
commit 2531242d1d
3 files changed
+28 -12

No files matched your search

+22 -6
View File
@@ -56,7 +56,6 @@ def grab_file_id(zip_url: str) -> str:
nerfstudio_file_ids = {
"bunny": grab_file_id("https://drive.google.com/file/d/1oVytSgd1gQclF0CybJ6JdXDmaqKOx7Wg/view?usp=sharing"),
"bww_entrance": grab_file_id("https://drive.google.com/file/d/1ylkRHtfB3n3IRLf2wplpfxzPTq7nES9I/view?usp=sharing"),
"bww_tree": grab_file_id("https://drive.google.com/file/d/1N_OQejT0MblK1UP05KORxy25SXjKqZN1/view?usp=sharing"),
"campanile": grab_file_id("https://drive.google.com/file/d/13aOfGJRRH05pOOk9ikYGTwqFc2L1xskU/view?usp=sharing"),
@@ -77,11 +76,11 @@ nerfstudio_file_ids = {
DatasetName = tyro.extras.literal_type_from_choices(nerfstudio_file_ids.keys())
def download_nerfstudio(save_dir: Path, capture_name: str):
"""Download specific captures from the nerfstudio dataset."""
def download_capture_name(save_dir: Path, dataset_name: str, capture_name: str, capture_name_to_file_id: dict):
"""Download specific captures a given dataset and capture name."""
url = f"https://drive.google.com/uc?id={nerfstudio_file_ids[capture_name]}"
target_path = str(save_dir / f"nerfstudio/{capture_name}")
url = f"https://drive.google.com/uc?id={capture_name_to_file_id[capture_name]}"
target_path = str(save_dir / f"{dataset_name}/{capture_name}")
os.makedirs(target_path, exist_ok=True)
download_path = Path(f"{target_path}.zip")
tmp_path = str(save_dir / ".temp")
@@ -99,8 +98,23 @@ def download_nerfstudio(save_dir: Path, capture_name: str):
os.remove(download_path)
def download_nerfstudio(save_dir: Path, capture_name: str):
"""Download specific captures for the nerfstudio dataset."""
download_capture_name(save_dir, "nerfstudio", capture_name, capture_name_to_file_id=nerfstudio_file_ids)
record3d_file_ids = {
"bear": grab_file_id("https://drive.google.com/file/d/1WRZohWMRj0nNlYFIEBwkddDoGPvLTzkR/view?usp=sharing"),
}
def download_record3d(save_dir: Path, capture_name: str):
"""Download specific captures for the record3d dataset."""
download_capture_name(save_dir, "record3d", capture_name, capture_name_to_file_id=record3d_file_ids)
def main(
dataset: Literal["blender", "friends", "nerfstudio"],
dataset: Literal["blender", "friends", "nerfstudio", "record3d"],
capture_name: Optional[DatasetName] = None, # type: ignore
save_dir: Path = Path("data/"),
):
@@ -137,6 +151,8 @@ def main(
console.print(f"\t {capture_names}")
sys.exit()
download_nerfstudio(save_dir, capture_name)
if dataset == "record3d":
download_record3d(save_dir, "bear")
def entrypoint():