Using pydrive with user credentials for authenticated download #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Unfortunately, when using your code, an anonymous download is performed and I tried several consecutive days, I always got an exceeded quota error making me unable to download the dataset.
This pull requests, which uses code adapted from the FFHQ-Aging repo is using user credentials for downloading the dataset.
The only requirement is to follow the pydrive quickstart for getting the
client_secrets.json
file placed in the same directory thandownload_ffhq.py
and you can then indicate you want to use pydrive google authentication by appending the--pydrive
command line option.So for example, for downloading the 1024x1024 images, you simply :
In the code, several attempts are tried to download a file. Without that code, inspired by yours, I got some
httplib2.error.ServerNotFoundError: Unable to find the server at www.googleapis.com
being raised. Apparently, retrying the download a second time and the exception is not raised.I only tested the download of the images (the command line above) but as the other downloads go through the
download_files
function, I hope it works as well for the other downloads.