pyiqa.utils.download_util¶
Module Contents¶
- pyiqa.utils.download_util.download_file_from_google_drive(file_id, save_path)[source]¶
Download files from google drive.
Ref: https://stackoverflow.com/questions/25010369/wget-curl-large-file-from-google-drive # noqa E501
- Parameters:
file_id (str) – File id.
save_path (str) – Save path.
- pyiqa.utils.download_util.save_response_content(response, destination, file_size=None, chunk_size=32768)[source]¶
- pyiqa.utils.download_util.load_file_from_url(url, model_dir=None, progress=True, file_name=None)[source]¶
Load file form http url, will download models if necessary.
Ref:https://github.com/1adrianb/face-alignment/blob/master/face_alignment/utils.py
- Parameters:
url (str) – URL to be downloaded.
model_dir (str) – The path to save the downloaded model. Should be a full path. If None, use pytorch hub_dir. Default: None.
progress (bool) – Whether to show the download progress. Default: True.
file_name (str) – The downloaded file name. If None, use the file name in the url. Default: None.
- Returns:
The path to the downloaded file.
- Return type:
str