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

Make downloading more windows-friendly #2810

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

VasuAgrawal
Copy link
Contributor

I ran into a few issues while running the various download commands on my Windows box. This diff attempts to remedy those issues. In no particular order:

  • Switching from os.system to subprocess.run calls, which have better handling of ' vs " and other shell escapes. In particular, the ' which were previously used (line 431) weren't working in CMD, which is used by os.system on my machine. They work fine in powershell, though.
  • Updated curl call to use -o flag to directly output to file, rather than going through IO redirection.
  • Updated all download functions to use unique temp directories, rather than sharing .temp. This allows multiple download jobs to run concurrently, since they're typically rate-limited by the upstream.
  • More informative error message for when there's more than 1 inner folder, though I haven't run into this issue since switching the temp folder names.

@@ -143,10 +144,10 @@ def download_capture_name(save_dir: Path, dataset_name: str, capture_name: str,
file_id_or_zip_url = capture_name_to_file_id[capture_name]
if file_id_or_zip_url.endswith(".zip"):
url = file_id_or_zip_url # zip url
target_path = str(save_dir / f"{dataset_name}/{capture_name}")
target_path = str(save_dir / f"{dataset_name}" / f"{capture_name}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider simplifying this and other similar changes:

Suggested change
target_path = str(save_dir / f"{dataset_name}" / f"{capture_name}")
target_path = str(save_dir / dataset_name / capture_name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, midnight brain wasn't thinking too hard. I'll fix this.

@VasuAgrawal
Copy link
Contributor Author

Fixed. Also rebased the changes to be on top of master again.

Copy link
Collaborator

@brentyi brentyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @VasuAgrawal @cr333!!

@brentyi brentyi merged commit 7cc27da into nerfstudio-project:main Jan 23, 2024
2 checks passed
@VasuAgrawal VasuAgrawal deleted the vasu-windows-download branch January 25, 2024 15:13
ArpegorPSGH pushed a commit to ArpegorPSGH/nerfstudio that referenced this pull request Jun 22, 2024
* Make downloading more windows-friendly

* Remove unnecessary f-strings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants