(out_dir, category, set_name, tag)
| 25 | |
| 26 | |
| 27 | def download(out_dir, category, set_name, tag): |
| 28 | url = 'http://lsun.cs.princeton.edu/htbin/download.cgi?tag={tag}' \ |
| 29 | '&category={category}&set={set_name}'.format(**locals()) |
| 30 | if set_name == 'test': |
| 31 | out_name = 'test_lmdb.zip' |
| 32 | else: |
| 33 | out_name = '{category}_{set_name}_lmdb.zip'.format(**locals()) |
| 34 | out_path = join(out_dir, out_name) |
| 35 | cmd = ['curl', url, '-o', out_path] |
| 36 | print('Downloading', category, set_name, 'set') |
| 37 | subprocess.call(cmd) |
| 38 | |
| 39 | |
| 40 | def main(): |