diff --git a/.pre-commit-config-zh-cn.yaml b/.pre-commit-config-zh-cn.yaml index 0b0f85cac..73f0388fe 100644 --- a/.pre-commit-config-zh-cn.yaml +++ b/.pre-commit-config-zh-cn.yaml @@ -1,7 +1,7 @@ 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.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 @@ -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: v2.32.1 + rev: v3.0.0 hooks: - id: pyupgrade args: ["--py36-plus"] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f4dd84c0b..2f7fdf013 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ 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.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 @@ -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: v2.32.1 + rev: v3.0.0 hooks: - id: pyupgrade args: ["--py36-plus"] diff --git a/docs/en/understand_mmcv/data_process.md b/docs/en/understand_mmcv/data_process.md index 0255c43d2..3b90ea025 100644 --- a/docs/en/understand_mmcv/data_process.md +++ b/docs/en/understand_mmcv/data_process.md @@ -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) @@ -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) diff --git a/docs/zh_cn/understand_mmcv/data_process.md b/docs/zh_cn/understand_mmcv/data_process.md index 6abf91397..7e0afd1e6 100644 --- a/docs/zh_cn/understand_mmcv/data_process.md +++ b/docs/zh_cn/understand_mmcv/data_process.md @@ -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 (右) @@ -272,4 +272,4 @@ img1 (左) and img2 (右) 变换后的图像和真实图像的差异 -![warpped image](../../en/_static/flow_warp_diff.png) +![warped image](../../en/_static/flow_warp_diff.png) diff --git a/mmcv/ops/active_rotated_filter.py b/mmcv/ops/active_rotated_filter.py index 46c2aa780..b8ba43dd4 100644 --- a/mmcv/ops/active_rotated_filter.py +++ b/mmcv/ops/active_rotated_filter.py @@ -47,12 +47,12 @@ class ActiveRotatedFilterFunction(Function): 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 diff --git a/mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp b/mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp index 0579da879..87077b5c4 100644 --- a/mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp +++ b/mmcv/ops/csrc/pytorch/mlu/psamask_mlu.cpp @@ -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"; @@ -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"; diff --git a/mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp b/mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp index 077dbfc51..361bba25f 100644 --- a/mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp +++ b/mmcv/ops/csrc/pytorch/mlu/roi_align_mlu.cpp @@ -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()); @@ -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); diff --git a/mmcv/ops/rotated_feature_align.py b/mmcv/ops/rotated_feature_align.py index 7d5954ddf..0132c0486 100644 --- a/mmcv/ops/rotated_feature_align.py +++ b/mmcv/ops/rotated_feature_align.py @@ -66,11 +66,11 @@ class RotatedFeatureAlignFunction(Function): 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 diff --git a/mmcv/video/io.py b/mmcv/video/io.py index 0ecc5eabb..378f5b9f7 100644 --- a/mmcv/video/io.py +++ b/mmcv/video/io.py @@ -41,7 +41,7 @@ class Cache: 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. diff --git a/setup.cfg b/setup.cfg index 85058dafd..dc8d3768e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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