Skip to content

Conversation

@JoelKronander
Copy link
Contributor

Added a download utility function in files.py, maybe_download_and_extract, that tries to find filename in working_dir otherwise downloads with progress bar and optionally extracts .tar and .zip files.

Also updated the tutorial_vgg16 example to use the new function.
Several dataset loaders in files could also adapt the new function for improved consistency.

@zsdonghao
Copy link
Member

@JoelKronander could we simplify the args of function ? e.g. use format='zip' instead of is_tar, is_zip? do you think it is better?

@JoelKronander
Copy link
Contributor Author

Just updated a new version with an optional extract=True/False option. If set to True, detects if .tar or .zip files and uncompresses.

@JoelKronander JoelKronander changed the title Download utility function maybe_download_and_extract() Added download utility function : maybe_download_and_extract() Jan 9, 2017
…onally extracting .zip or .tar files

Minor fixes

Updated VGG16 tutorial to automatically download files

changed interface to extract=True/False and automatic detect if .zip or .tar file

added return value as filepath
@JoelKronander
Copy link
Contributor Author

Is something like this interface what you had in mind? Or should I change it to something else?
I could also clean up some code in the files.py to use this new function instead of repeated definitions of private download functions if you like.

@boscotsang
Copy link
Contributor

I've adding the path argument to the load dataset functions. I think you can replace the origin download and extract function with your maybe_download_and_extract() function.

@JoelKronander
Copy link
Contributor Author

superceded by PR#72

@JoelKronander JoelKronander deleted the download_utility_and_file_downloading_clean_up branch January 15, 2017 00:30
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