Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
b0f40396
Commit
b0f40396
authored
Mar 10, 2019
by
Aitical
Committed by
Kai Chen
Mar 09, 2019
Browse files
Update the documentation (#36)
* update the documentation * update the documentation * Update io.md
parent
76bcbe2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
docs/io.md
docs/io.md
+2
-2
No files found.
docs/io.md
View file @
b0f40396
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment