Skip to content

Commit

Permalink
Pathlib Python 3.7 Compatibility Fix (nerfstudio-project#831)
Browse files Browse the repository at this point in the history
small fix.
  • Loading branch information
akristoffersen authored Oct 25, 2022
1 parent 9d054f2 commit 8a6bca5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/downloads/download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def download_blender(save_dir: Path):
unzip_path = save_dir / Path("nerf_synthetic")
final_path = save_dir / Path("blender")
unzip_path.rename(final_path)
download_path.unlink(missing_ok=True)
if download_path.exists():
download_path.unlink()


def download_friends(save_dir: Path):
Expand Down Expand Up @@ -123,7 +124,8 @@ def download_dnerf(save_dir: Path):
unzip_path = save_dir / Path("data")
final_path = save_dir / Path("dnerf")
unzip_path.rename(final_path)
download_path.unlink(missing_ok=True)
if download_path.exists():
download_path.unlink()


def main(
Expand Down
5 changes: 4 additions & 1 deletion scripts/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,10 @@ def run_colmap(

colmap_version = get_colmap_version()

(colmap_dir / "database.db").unlink(missing_ok=True)
colmap_database_path = colmap_dir / "database.db"
if colmap_database_path.exists():
# Can't use missing_ok argument because of Python 3.7 compatibility.
colmap_database_path.unlink()

# Feature extraction
feature_extractor_cmd = [
Expand Down

0 comments on commit 8a6bca5

Please sign in to comment.