"vscode:/vscode.git/clone" did not exist on "829f6defa44f93b84416aba36e5f43952c2df8bc"
Commit b0f40396 authored by Aitical's avatar Aitical Committed by Kai Chen
Browse files

Update the documentation (#36)

* update the documentation

* update the documentation

* Update io.md
parent 76bcbe2d
...@@ -18,14 +18,14 @@ with open('test.json', 'r') as f: ...@@ -18,14 +18,14 @@ with open('test.json', 'r') as f:
data = mmcv.load(f) data = mmcv.load(f)
# dump data to a string # dump data to a string
json_str = mmcv.dump(data, format='json') json_str = mmcv.dump(data, file_format='json')
# dump data to a file with a filename (infer format from file extension) # dump data to a file with a filename (infer format from file extension)
mmcv.dump(data, 'out.pkl') mmcv.dump(data, 'out.pkl')
# dump data to a file with a file-like object # dump data to a file with a file-like object
with open('test.yaml', 'w') as f: with open('test.yaml', 'w') as f:
data = mmcv.dump(data, f, format='yaml') data = mmcv.dump(data, f, file_format='yaml')
``` ```
It is also very convenient to extend the api to support more file formats. It is also very convenient to extend the api to support more file formats.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment