Shortcuts

mmagic.utils.io_utils

Module Contents

Functions

get_content_from_url(url[, timeout, stream])

Get content from url.

download_from_url(url[, dest_path, dest_dir, hash_prefix])

Download object at the given URL to a local path.

Attributes

MMAGIC_CACHE_DIR

mmagic.utils.io_utils.MMAGIC_CACHE_DIR[source]
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

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.