Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathlib Python 3.7 Compatibility Fix #831

Merged
merged 2 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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