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
fccb1091
Unverified
Commit
fccb1091
authored
Feb 18, 2022
by
Jiazhen Wang
Committed by
GitHub
Feb 18, 2022
Browse files
Imporve the docstring of imfrombytes and fix a deprecation-warning (#1731)
parent
c1de4c9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
mmcv/image/io.py
mmcv/image/io.py
+2
-0
mmcv/runner/hooks/logger/text.py
mmcv/runner/hooks/logger/text.py
+1
-1
No files found.
mmcv/image/io.py
View file @
fccb1091
...
@@ -213,6 +213,8 @@ def imfrombytes(content, flag='color', channel_order='bgr', backend=None):
...
@@ -213,6 +213,8 @@ def imfrombytes(content, flag='color', channel_order='bgr', backend=None):
Args:
Args:
content (bytes): Image bytes got from files or other streams.
content (bytes): Image bytes got from files or other streams.
flag (str): Same as :func:`imread`.
flag (str): Same as :func:`imread`.
channel_order (str): The channel order of the output, candidates
are 'bgr' and 'rgb'. Default to 'bgr'.
backend (str | None): The image decoding backend type. Options are
backend (str | None): The image decoding backend type. Options are
`cv2`, `pillow`, `turbojpeg`, `tifffile`, `None`. If backend is
`cv2`, `pillow`, `turbojpeg`, `tifffile`, `None`. If backend is
None, the global imread_backend specified by ``mmcv.use_backend()``
None, the global imread_backend specified by ``mmcv.use_backend()``
...
...
mmcv/runner/hooks/logger/text.py
View file @
fccb1091
...
@@ -109,7 +109,7 @@ class TextLoggerHook(LoggerHook):
...
@@ -109,7 +109,7 @@ class TextLoggerHook(LoggerHook):
def
_get_max_memory
(
self
,
runner
):
def
_get_max_memory
(
self
,
runner
):
device
=
getattr
(
runner
.
model
,
'output_device'
,
None
)
device
=
getattr
(
runner
.
model
,
'output_device'
,
None
)
mem
=
torch
.
cuda
.
max_memory_allocated
(
device
=
device
)
mem
=
torch
.
cuda
.
max_memory_allocated
(
device
=
device
)
mem_mb
=
torch
.
tensor
([
mem
/
(
1024
*
1024
)],
mem_mb
=
torch
.
tensor
([
int
(
mem
)
/
/
(
1024
*
1024
)],
dtype
=
torch
.
int
,
dtype
=
torch
.
int
,
device
=
device
)
device
=
device
)
if
runner
.
world_size
>
1
:
if
runner
.
world_size
>
1
:
...
...
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