Modified (with no API keys) download script to make it work properly#5
Modified (with no API keys) download script to make it work properly#5nekita473 wants to merge 1 commit intoNVlabs:masterfrom
Conversation
…google drive, added url modification to bypass antivirus warning
|
Thanks for sharing. new errors occured. So, I went on kaggle: kaggle datasets download -d rahulbhalley/ffhq-1024x1024 Perhaps another alternative... https://datasets.activeloop.ai/docs/ml/datasets/ffhq-dataset/ |
|
Has anybody solved this issue? |
|
hi @nekita473 |
|
A workaround for the people trying to download in the command line, the following downloads the zip file with the 1024x1024 images: for the other files, just (start) downloading the file in the browser to get the file id* and replace it by the id in the url above. *In Firefox, there is a "copy download link" if you right-click on the cancelled download. This link doesn't work directly in wget, but you can use it to get the file id. |
|
... need to change line 35 in download_ffhq.py to: |
|
Hi Mr. Andrzej
Thank you for replying my message.
I changed the url file to the one you provided. But I am getting the
following error:
Downloading JSON metadata...
- 0.00% done 1/2 files 0.00/0.25 GB 0.00 B/s ETA: ...
Traceback (most recent call last):
File "/home/cvlab/jasurbek/ffhq-dataset/ffhq-dataset/download_ffhq.py",
line 445, in <module>
run_cmdline(sys.argv)
File "/home/cvlab/jasurbek/ffhq-dataset/ffhq-dataset/download_ffhq.py",
line 440, in run_cmdline
run(**vars(args))
File "/home/cvlab/jasurbek/ffhq-dataset/ffhq-dataset/download_ffhq.py",
line 387, in run
download_files([json_spec, license_specs['json']], **download_kwargs)
File "/home/cvlab/jasurbek/ffhq-dataset/ffhq-dataset/download_ffhq.py",
line 205, in download_files
raise exc_info[1].with_traceback(exc_info[2])
File "/home/cvlab/jasurbek/ffhq-dataset/ffhq-dataset/download_ffhq.py",
line 214, in _download_thread
download_file(session, spec, stats, **download_kwargs)
File "/home/cvlab/jasurbek/ffhq-dataset/ffhq-dataset/download_ffhq.py",
line 73, in download_file
res.raise_for_status()
File "/usr/local/lib/python3.10/dist-packages/requests/models.py", line
1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url:
https://drive.google.com/uc?id=16N0RV4fHI6joBuKbQAoG34V_cQk7vxSA
**&confirm=yes**
Could you please have a look at it .
Thank you in advance f
Sincerely
Jasurbek
[image: Mailtrack]
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&>
Sender
notified by
Mailtrack
<https://mailtrack.io?utm_source=gmail&utm_medium=signature&utm_campaign=signaturevirality11&>
12/12/23,
02:37:41 PM
…On Fri, Dec 1, 2023 at 6:22 PM Andrzej M. ***@***.***> wrote:
... need to change line 35 in download_ffhq.py to:
file_url='
https://drive.google.com/uc?id=16N0RV4fHI6joBuKbQAoG34V_cQk7vxSA**&confirm=yes
**'
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQKLHTQPBNPLQYKFYFUFOUTYHGOXFAVCNFSM6AAAAAASEXGKWWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZVG42TCMJRGU>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
I have done some modification on the download_ffhq.py and successfully downloaded the datast with it. Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.This work is licensed under the Creative CommonsAttribution-NonCommercial-ShareAlike 4.0 International License.To view a copy of this license, visithttp://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter toCreative Commons, PO Box 1866, Mountain View, CA 94042, USA."""Download Flickr-Faces-HQ (FFHQ) dataset to current working directory.""" import os PIL.ImageFile.LOAD_TRUNCATED_IMAGES = True # avoid "Decompressed Data Too Large" error #---------------------------------------------------------------------------- json_spec = dict(file_url='https://drive.google.com/uc?id=16N0RV4fHI6joBuKbQAoG34V_cQk7vxSA', file_path='ffhq-dataset-v2.json', file_size=267793842, file_md5='425ae20f06a4da1d4dc0f46d40ba5fd6') tfrecords_specs = [ license_specs = { headers = { home = osp.expanduser("~") #---------------------------------------------------------------------------- def download_file(session, file_spec, stats, chunk_size=128, num_attempts=10, **kwargs): #---------------------------------------------------------------------------- def choose_bytes_unit(num_bytes): #---------------------------------------------------------------------------- def format_time(seconds): #---------------------------------------------------------------------------- def download_files(file_specs, num_threads=32, status_delay=0.2, timing_window=50, **download_kwargs): def _download_thread(spec_queue, exception_queue, stats, download_kwargs): #---------------------------------------------------------------------------- def print_statistics(json_data): #---------------------------------------------------------------------------- def recreate_aligned_images(json_data, source_dir, dst_dir='realign1024x1024', output_size=1024, transform_size=4096, enable_padding=True, rotate_level=True, random_shift=0.0, retry_crops=False): #---------------------------------------------------------------------------- def run(tasks, **download_kwargs): #---------------------------------------------------------------------------- def run_cmdline(argv): #---------------------------------------------------------------------------- if name == "main": #---------------------------------------------------------------------------- |
|
@jasuriy can you do me a favor and put your code in a triple back tick code block: e.g |
Added cookies and headers to avoid ban from google drive and url modification to bypass antivirus warning.