mmagic.utils.io_utils
¶
Module Contents¶
Functions¶
|
Get content from url. |
|
Download object at the given URL to a local path. |
Attributes¶
- mmagic.utils.io_utils.get_content_from_url(url, timeout=15, stream=False)[source]¶
Get content from url.
- Parameters
url (str) – Url for getting content.
timeout (int) – Set the socket timeout. Default: 15.
- mmagic.utils.io_utils.download_from_url(url, dest_path=None, dest_dir=MMAGIC_CACHE_DIR, hash_prefix=None)[source]¶
Download object at the given URL to a local path.
- Parameters
url (str) – URL of the object to download.
dest_path (str) – Path where object will be saved.
dest_dir (str) – The directory of the destination. Defaults to
'~/.cache/openmmlab/mmagic/'
.hash_prefix (string, optional) – If not None, the SHA256 downloaded file should start with hash_prefix. Default: None.
- Returns
path for the downloaded file.
- Return type
str