mmengine.fileio — mmengine 0.10.7 documentation (original) (raw)

mmengine.fileio

File Backend

BaseStorageBackend Abstract class of storage backends.
FileClient A general file client to access files in different backends.
HardDiskBackend Raw hard disks storage backend.
LocalBackend Raw local storage backend.
HTTPBackend HTTP and HTTPS storage bachend.
LmdbBackend Lmdb storage backend.
MemcachedBackend Memcached storage backend.
PetrelBackend Petrel storage backend (for internal usage).

File Handler

File IO

dump Dump data to json/yaml/pickle strings or files.
load Load data from json/yaml/pickle files.
copy_if_symlink_fails Create a symbolic link pointing to src named dst.
copyfile Copy a file src to dst and return the destination file.
copyfile_from_local Copy a local file src to dst and return the destination file.
copyfile_to_local Copy the file src to local dst and return the destination file.
copytree Recursively copy an entire directory tree rooted at src to a directory named dst and return the destination directory.
copytree_from_local Recursively copy an entire directory tree rooted at src to a directory named dst and return the destination directory.
copytree_to_local Recursively copy an entire directory tree rooted at src to a local directory named dst and return the destination directory.
exists Check whether a file path exists.
generate_presigned_url Generate the presigned url of video stream which can be passed to mmcv.VideoReader.
get Read bytes from a given filepath with 'rb' mode.
get_file_backend Return a file backend based on the prefix of uri or backend_args.
get_local_path Download data from filepath and write the data to local path.
get_text Read text from a given filepath with 'r' mode.
isdir Check whether a file path is a directory.
isfile Check whether a file path is a file.
join_path Concatenate all file paths.
list_dir_or_file Scan a directory to find the interested directories or files in arbitrary order.
put Write bytes to a given filepath with 'wb' mode.
put_text Write text to a given filepath with 'w' mode.
remove Remove a file.
rmtree Recursively delete a directory tree.

Parse File

dict_from_file Load a text file and parse the content as a dict.
list_from_file Load a text file and parse the content as a list of strings.