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
4cfd45f7
Commit
4cfd45f7
authored
Oct 06, 2018
by
Kai Chen
Browse files
minor fix
parent
6d623cf1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
docs/api.rst
docs/api.rst
+0
-1
mmcv/image/transforms/geometry.py
mmcv/image/transforms/geometry.py
+3
-3
mmcv/runner/runner.py
mmcv/runner/runner.py
+1
-0
No files found.
docs/api.rst
View file @
4cfd45f7
...
@@ -16,7 +16,6 @@ video
...
@@ -16,7 +16,6 @@ video
--------------
--------------
.. automodule:: mmcv.video
.. automodule:: mmcv.video
:members:
:members:
:exclude-members: VideoWriter_fourcc
arraymisc
arraymisc
--------------
--------------
...
...
mmcv/image/transforms/geometry.py
View file @
4cfd45f7
...
@@ -109,7 +109,7 @@ def bbox_scaling(bboxes, scale, clip_shape=None):
...
@@ -109,7 +109,7 @@ def bbox_scaling(bboxes, scale, clip_shape=None):
return
scaled_bboxes
return
scaled_bboxes
def
imcrop
(
img
,
bboxes
,
scale
_ratio
=
1.0
,
pad_fill
=
None
):
def
imcrop
(
img
,
bboxes
,
scale
=
1.0
,
pad_fill
=
None
):
"""Crop image patches.
"""Crop image patches.
3 steps: scale the bboxes -> clip bboxes -> crop and pad.
3 steps: scale the bboxes -> clip bboxes -> crop and pad.
...
@@ -117,7 +117,7 @@ def imcrop(img, bboxes, scale_ratio=1.0, pad_fill=None):
...
@@ -117,7 +117,7 @@ def imcrop(img, bboxes, scale_ratio=1.0, pad_fill=None):
Args:
Args:
img (ndarray): Image to be cropped.
img (ndarray): Image to be cropped.
bboxes (ndarray): Shape (k, 4) or (4, ), location of cropped bboxes.
bboxes (ndarray): Shape (k, 4) or (4, ), location of cropped bboxes.
scale
_ratio
(float, optional): Scale ratio of bboxes, the default value
scale (float, optional): Scale ratio of bboxes, the default value
1.0 means no padding.
1.0 means no padding.
pad_fill (number or list): Value to be filled for padding, None for
pad_fill (number or list): Value to be filled for padding, None for
no padding.
no padding.
...
@@ -132,7 +132,7 @@ def imcrop(img, bboxes, scale_ratio=1.0, pad_fill=None):
...
@@ -132,7 +132,7 @@ def imcrop(img, bboxes, scale_ratio=1.0, pad_fill=None):
assert
len
(
pad_fill
)
==
chn
assert
len
(
pad_fill
)
==
chn
_bboxes
=
bboxes
[
None
,
...]
if
bboxes
.
ndim
==
1
else
bboxes
_bboxes
=
bboxes
[
None
,
...]
if
bboxes
.
ndim
==
1
else
bboxes
scaled_bboxes
=
bbox_scaling
(
_bboxes
,
scale
_ratio
).
astype
(
np
.
int32
)
scaled_bboxes
=
bbox_scaling
(
_bboxes
,
scale
).
astype
(
np
.
int32
)
clipped_bbox
=
bbox_clip
(
scaled_bboxes
,
img
.
shape
)
clipped_bbox
=
bbox_clip
(
scaled_bboxes
,
img
.
shape
)
patches
=
[]
patches
=
[]
...
...
mmcv/runner/runner.py
View file @
4cfd45f7
...
@@ -381,6 +381,7 @@ class Runner(object):
...
@@ -381,6 +381,7 @@ class Runner(object):
"""Register default hooks for training.
"""Register default hooks for training.
Default hooks include:
Default hooks include:
- LrUpdaterHook
- LrUpdaterHook
- OptimizerStepperHook
- OptimizerStepperHook
- CheckpointSaverHook
- CheckpointSaverHook
...
...
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