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
75ea2f89
Unverified
Commit
75ea2f89
authored
Oct 11, 2022
by
Zaida Zhou
Committed by
GitHub
Oct 11, 2022
Browse files
Upgrade the versions of pre-commit hooks (#2328)
parent
07e8775f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
26 additions
and
26 deletions
+26
-26
.pre-commit-config-zh-cn.yaml
.pre-commit-config-zh-cn.yaml
+5
-5
.pre-commit-config.yaml
.pre-commit-config.yaml
+5
-5
docs/en/understand_mmcv/data_process.md
docs/en/understand_mmcv/data_process.md
+4
-4
docs/zh_cn/understand_mmcv/data_process.md
docs/zh_cn/understand_mmcv/data_process.md
+2
-2
mmcv/ops/active_rotated_filter.py
mmcv/ops/active_rotated_filter.py
+2
-2
mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp
mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp
+2
-2
mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp
mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp
+2
-2
mmcv/ops/rotated_feature_align.py
mmcv/ops/rotated_feature_align.py
+2
-2
mmcv/video/io.py
mmcv/video/io.py
+1
-1
setup.cfg
setup.cfg
+1
-1
No files found.
.pre-commit-config-zh-cn.yaml
View file @
75ea2f89
exclude
:
^tests/data/
repos
:
-
repo
:
https://gitee.com/openmmlab/mirrors-flake8
rev
:
3.8.3
rev
:
5.0.4
hooks
:
-
id
:
flake8
-
repo
:
https://gitee.com/openmmlab/mirrors-isort
...
...
@@ -9,11 +9,11 @@ repos:
hooks
:
-
id
:
isort
-
repo
:
https://gitee.com/openmmlab/mirrors-yapf
rev
:
v0.3
0
.0
rev
:
v0.3
2
.0
hooks
:
-
id
:
yapf
-
repo
:
https://gitee.com/openmmlab/mirrors-pre-commit-hooks
rev
:
v
3.1
.0
rev
:
v
4.3
.0
hooks
:
-
id
:
trailing-whitespace
-
id
:
check-yaml
...
...
@@ -26,7 +26,7 @@ repos:
-
id
:
mixed-line-ending
args
:
[
"
--fix=lf"
]
-
repo
:
https://gitee.com/openmmlab/mirrors-codespell
rev
:
v2.
1.0
rev
:
v2.
2.1
hooks
:
-
id
:
codespell
-
repo
:
https://gitee.com/openmmlab/mirrors-mdformat
...
...
@@ -44,7 +44,7 @@ repos:
-
id
:
docformatter
args
:
[
"
--in-place"
,
"
--wrap-descriptions"
,
"
79"
]
-
repo
:
https://github.com/asottile/pyupgrade
rev
:
v
2.32.1
rev
:
v
3.0.0
hooks
:
-
id
:
pyupgrade
args
:
[
"
--py36-plus"
]
...
...
.pre-commit-config.yaml
View file @
75ea2f89
exclude
:
^tests/data/
repos
:
-
repo
:
https://github.com/PyCQA/flake8
rev
:
3.8.3
rev
:
5.0.4
hooks
:
-
id
:
flake8
-
repo
:
https://github.com/PyCQA/isort
...
...
@@ -9,11 +9,11 @@ repos:
hooks
:
-
id
:
isort
-
repo
:
https://github.com/pre-commit/mirrors-yapf
rev
:
v0.3
0
.0
rev
:
v0.3
2
.0
hooks
:
-
id
:
yapf
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
v
3.1
.0
rev
:
v
4.3
.0
hooks
:
-
id
:
trailing-whitespace
-
id
:
check-yaml
...
...
@@ -26,7 +26,7 @@ repos:
-
id
:
mixed-line-ending
args
:
[
"
--fix=lf"
]
-
repo
:
https://github.com/codespell-project/codespell
rev
:
v2.
1.0
rev
:
v2.
2.1
hooks
:
-
id
:
codespell
-
repo
:
https://github.com/executablebooks/mdformat
...
...
@@ -44,7 +44,7 @@ repos:
-
id
:
docformatter
args
:
[
"
--in-place"
,
"
--wrap-descriptions"
,
"
79"
]
-
repo
:
https://github.com/asottile/pyupgrade
rev
:
v
2.32.1
rev
:
v
3.0.0
hooks
:
-
id
:
pyupgrade
args
:
[
"
--py36-plus"
]
...
...
docs/en/understand_mmcv/data_process.md
View file @
75ea2f89
...
...
@@ -265,12 +265,12 @@ mmcv.flowshow(flow)

3.
Flow warp
p
ing
3.
Flow warping
```
python
img1
=
mmcv
.
imread
(
'img1.jpg'
)
flow
=
mmcv
.
flowread
(
'flow.flo'
)
warp
p
ed_img2
=
mmcv
.
flow_warp
(
img1
,
flow
)
warped_img2
=
mmcv
.
flow_warp
(
img1
,
flow
)
```
img1 (left) and img2 (right)
...
...
@@ -281,6 +281,6 @@ optical flow (img2 -> img1)

warp
p
ed image and difference with ground truth
warped image and difference with ground truth


docs/zh_cn/understand_mmcv/data_process.md
View file @
75ea2f89
...
...
@@ -259,7 +259,7 @@ mmcv.flowshow(flow)
```
python
img1
=
mmcv
.
imread
(
'img1.jpg'
)
flow
=
mmcv
.
flowread
(
'flow.flo'
)
warp
p
ed_img2
=
mmcv
.
flow_warp
(
img1
,
flow
)
warped_img2
=
mmcv
.
flow_warp
(
img1
,
flow
)
```
img1 (左) and img2 (右)
...
...
@@ -272,4 +272,4 @@ img1 (左) and img2 (右)
变换后的图像和真实图像的差异


mmcv/ops/active_rotated_filter.py
View file @
75ea2f89
...
...
@@ -47,12 +47,12 @@ class ActiveRotatedFilterFunction(Function):
def
backward
(
ctx
,
grad_out
:
torch
.
Tensor
)
->
Tuple
[
torch
.
Tensor
,
None
]:
"""
Args:
grad_output (torch.Tensor): The gradi
a
nt of output features
grad_output (torch.Tensor): The gradi
e
nt of output features
with shape [num_output_planes * num_rotations,
num_input_planes * num_orientations, H, W].
Returns:
torch.Tensor: The gradi
a
nt of input features with shape
torch.Tensor: The gradi
e
nt of input features with shape
[num_output_planes, num_input_planes, num_orientations, H, W].
"""
input
,
indices
=
ctx
.
saved_tensors
...
...
mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp
View file @
75ea2f89
...
...
@@ -161,7 +161,7 @@ void PSAMaskForwardMLUKernelLauncher(const int psa_type, const Tensor x,
TORCH_CHECK
(
h_feature
*
w_feature
==
y_c
,
"channel of y should be the same as h_feature * w_feature"
);
TORCH_CHECK
(
psa_type
==
0
||
psa_type
==
1
,
"psa_type only supp
u
rts 'COLLECT' and 'DISTRIBUTE' currently"
);
"psa_type only supp
o
rts 'COLLECT' and 'DISTRIBUTE' currently"
);
if
(
x
.
numel
()
==
0
)
{
CNLOG
(
INFO
)
<<
"skip zero-element tensor"
;
...
...
@@ -227,7 +227,7 @@ void PSAMaskBackwardMLUKernelLauncher(const int psa_type, const Tensor dy,
TORCH_CHECK
(
h_mask
*
w_mask
==
dx_c
,
"channel of dx should be the same as h_mask * w_mask"
);
TORCH_CHECK
(
psa_type
==
0
||
psa_type
==
1
,
"psa_type only supp
u
rts 'COLLECT' and 'DISTRIBUTE' currently"
);
"psa_type only supp
o
rts 'COLLECT' and 'DISTRIBUTE' currently"
);
if
(
dx
.
numel
()
==
0
)
{
CNLOG
(
INFO
)
<<
"skip zero-element tensor"
;
...
...
mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp
View file @
75ea2f89
...
...
@@ -45,7 +45,7 @@ void ROIAlignForwardMLUKernelLauncher(Tensor input, Tensor rois, Tensor output,
input
.
dim
(),
"D"
);
TORCH_CHECK
(
rois
.
dim
()
==
2
,
"rois should be a 2d tensor, got "
,
rois
.
dim
(),
"D"
);
TORCH_CHECK
(
pool_mode
==
1
,
"pool_mode only supp
u
rts 'avg' currently"
);
TORCH_CHECK
(
pool_mode
==
1
,
"pool_mode only supp
o
rts 'avg' currently"
);
auto
memory_format
=
torch_mlu
::
cnnl
::
ops
::
get_channels_last_memory_format
(
input
.
dim
());
...
...
@@ -121,7 +121,7 @@ void ROIAlignBackwardMLUKernelLauncher(Tensor grad, Tensor rois,
"D"
);
TORCH_CHECK
(
rois
.
dim
()
==
2
,
"rois should be a 2d tensor, got "
,
rois
.
dim
(),
"D"
);
TORCH_CHECK
(
pool_mode
==
1
,
"pool_mode only supp
u
rts 'avg' currently"
);
TORCH_CHECK
(
pool_mode
==
1
,
"pool_mode only supp
o
rts 'avg' currently"
);
int
batch_size
=
grad_input
.
size
(
0
);
int
channels
=
grad_input
.
size
(
1
);
...
...
mmcv/ops/rotated_feature_align.py
View file @
75ea2f89
...
...
@@ -66,11 +66,11 @@ class RotatedFeatureAlignFunction(Function):
def
backward
(
ctx
:
Any
,
grad_output
:
torch
.
Tensor
)
->
tuple
:
"""
Args:
grad_output (torch.Tensor): The gradi
a
nt of output features
grad_output (torch.Tensor): The gradi
e
nt of output features
with shape [N,C,H,W].
Returns:
torch.Tensor: The gradi
a
nt of input features with shape [N,C,H,W].
torch.Tensor: The gradi
e
nt of input features with shape [N,C,H,W].
"""
best_rbboxes
=
ctx
.
saved_tensors
[
0
]
points
=
ctx
.
points
...
...
mmcv/video/io.py
View file @
75ea2f89
...
...
@@ -41,7 +41,7 @@ class Cache:
class
VideoReader
:
"""Video class with similar usage to a list object.
This video w
a
rpper class provides convenient apis to access frames.
This video wr
a
pper class provides convenient apis to access frames.
There exists an issue of OpenCV's VideoCapture class that jumping to a
certain frame may be inaccurate. It is fixed in this class by checking
the position after jumping each time.
...
...
setup.cfg
View file @
75ea2f89
...
...
@@ -23,4 +23,4 @@ default_section = THIRDPARTY
# than "BA"
[codespell]
quiet-level = 3
ignore-words-list = inout,hist,ba
ignore-words-list = inout,hist,ba
,ro,inh
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