Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade the versions of pre-commit hooks #2328

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pre-commit-config-zh-cn.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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
rev: 5.10.1
hooks:
- id: isort
- repo: https://gitee.com/openmmlab/mirrors-yapf
rev: v0.30.0
rev: v0.32.0
hooks:
- id: yapf
- repo: https://gitee.com/openmmlab/mirrors-pre-commit-hooks
rev: v3.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -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
Expand All @@ -44,7 +44,7 @@ repos:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.0.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
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
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
rev: v0.32.0
hooks:
- id: yapf
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: check-yaml
Expand All @@ -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
Expand All @@ -44,7 +44,7 @@ repos:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.1
rev: v3.0.0
hooks:
- id: pyupgrade
args: ["--py36-plus"]
Expand Down
8 changes: 4 additions & 4 deletions docs/en/understand_mmcv/data_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ mmcv.flowshow(flow)

![progress](../_static/flow_visualization.png)

3. Flow warpping
3. Flow warping

```python
img1 = mmcv.imread('img1.jpg')
flow = mmcv.flowread('flow.flo')
warpped_img2 = mmcv.flow_warp(img1, flow)
warped_img2 = mmcv.flow_warp(img1, flow)
```

img1 (left) and img2 (right)
Expand All @@ -281,6 +281,6 @@ optical flow (img2 -> img1)

![optical flow](../_static/flow_img2toimg1.png)

warpped image and difference with ground truth
warped image and difference with ground truth

![warpped image](../_static/flow_warp_diff.png)
![warped image](../_static/flow_warp_diff.png)
4 changes: 2 additions & 2 deletions docs/zh_cn/understand_mmcv/data_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ mmcv.flowshow(flow)
```python
img1 = mmcv.imread('img1.jpg')
flow = mmcv.flowread('flow.flo')
warpped_img2 = mmcv.flow_warp(img1, flow)
warped_img2 = mmcv.flow_warp(img1, flow)
```

img1 (左) and img2 (右)
Expand All @@ -272,4 +272,4 @@ img1 (左) and img2 (右)

变换后的图像和真实图像的差异

![warpped image](../../en/_static/flow_warp_diff.png)
![warped image](../../en/_static/flow_warp_diff.png)
4 changes: 2 additions & 2 deletions mmcv/ops/active_rotated_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ def forward(ctx, input: torch.Tensor,
def backward(ctx, grad_out: torch.Tensor) -> Tuple[torch.Tensor, None]:
"""
Args:
grad_output (torch.Tensor): The gradiant of output features
grad_output (torch.Tensor): The gradient of output features
with shape [num_output_planes * num_rotations,
num_input_planes * num_orientations, H, W].

Returns:
torch.Tensor: The gradiant of input features with shape
torch.Tensor: The gradient of input features with shape
[num_output_planes, num_input_planes, num_orientations, H, W].
"""
input, indices = ctx.saved_tensors
Expand Down
4 changes: 2 additions & 2 deletions mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 suppurts 'COLLECT' and 'DISTRIBUTE' currently");
"psa_type only supports 'COLLECT' and 'DISTRIBUTE' currently");

if (x.numel() == 0) {
CNLOG(INFO) << "skip zero-element tensor";
Expand Down Expand Up @@ -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 suppurts 'COLLECT' and 'DISTRIBUTE' currently");
"psa_type only supports 'COLLECT' and 'DISTRIBUTE' currently");

if (dx.numel() == 0) {
CNLOG(INFO) << "skip zero-element tensor";
Expand Down
4 changes: 2 additions & 2 deletions mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 suppurts 'avg' currently");
TORCH_CHECK(pool_mode == 1, "pool_mode only supports 'avg' currently");

auto memory_format =
torch_mlu::cnnl::ops::get_channels_last_memory_format(input.dim());
Expand Down Expand Up @@ -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 suppurts 'avg' currently");
TORCH_CHECK(pool_mode == 1, "pool_mode only supports 'avg' currently");

int batch_size = grad_input.size(0);
int channels = grad_input.size(1);
Expand Down
4 changes: 2 additions & 2 deletions mmcv/ops/rotated_feature_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def forward(ctx: Any, features: torch.Tensor, best_rbboxes: torch.Tensor,
def backward(ctx: Any, grad_output: torch.Tensor) -> tuple:
"""
Args:
grad_output (torch.Tensor): The gradiant of output features
grad_output (torch.Tensor): The gradient of output features
with shape [N,C,H,W].

Returns:
torch.Tensor: The gradiant of input features with shape [N,C,H,W].
torch.Tensor: The gradient of input features with shape [N,C,H,W].
"""
best_rbboxes = ctx.saved_tensors[0]
points = ctx.points
Expand Down
2 changes: 1 addition & 1 deletion mmcv/video/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get(self, key, default=None):
class VideoReader:
"""Video class with similar usage to a list object.

This video warpper class provides convenient apis to access frames.
This video wrapper 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.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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