Shortcuts

mmedit.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

MMEDIT_CACHE_DIR

mmedit.utils.io_utils.MMEDIT_CACHE_DIR[源代码]
mmedit.utils.io_utils.get_content_from_url(url, timeout=15, stream=False)[源代码]

Get content from url.

参数
  • url (str) – Url for getting content.

  • timeout (int) – Set the socket timeout. Default: 15.

mmedit.utils.io_utils.download_from_url(url, dest_path=None, dest_dir=MMEDIT_CACHE_DIR, hash_prefix=None)[源代码]

Download object at the given URL to a local path.

参数
  • 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/mmgen/'.

  • hash_prefix (string, optional) – If not None, the SHA256 downloaded file should start with hash_prefix. Default: None.

返回

path for the downloaded file.

返回类型

str

Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.