"git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "413603ea84e55beefc73266e284df84f9b5637d1"
Unverified Commit 4243ff67 authored by Jingwei Zhang's avatar Jingwei Zhang Committed by GitHub
Browse files

[CI]: Upgrade pre-commit-hook in the dev-1.x branch (#1893)

* update pre-commit-hook config

* fix typos in new pre-commit-hook
parent d6ad6a7b
repos:
- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
......@@ -8,11 +8,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
......@@ -25,7 +25,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
......
......@@ -234,7 +234,7 @@ Actually, both [`IterBasedTrainLoop`](https://github.com/open-mmlab/mmengine/blo
```python
# Before 365001th iteration, we do evaluation every 5000 iterations.
# After 365000th iteration, we do evaluation every 368750 iteraions,
# After 365000th iteration, we do evaluation every 368750 iterations,
# which means that we do evaluation at the end of training.
interval = 5000
......
......@@ -411,7 +411,7 @@ param_scheduler = [
### Hook config
Users can attach hooks to training, validation, and testing loops to insert some oprations during running. There are two different hook fields, one is `default_hooks` and the other is `custom_hooks`.
Users can attach hooks to training, validation, and testing loops to insert some operations during running. There are two different hook fields, one is `default_hooks` and the other is `custom_hooks`.
`default_hooks` is a dict of hook configs. `default_hooks` are the hooks must required at runtime. They have default priority which should not be modified. If not set, runner will use the default values. To disable a default hook, users can set its config to `None`.
......
......@@ -98,19 +98,21 @@ class DataBaseSampler(object):
for more details. Defaults to dict(backend='disk').
"""
def __init__(self,
info_path: str,
data_root: str,
rate: float,
prepare: dict,
sample_groups: dict,
classes: Optional[List[str]] = None,
points_loader: dict = dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=[0, 1, 2, 3]),
file_client_args: dict = dict(backend='disk')) -> None:
def __init__(
self,
info_path: str,
data_root: str,
rate: float,
prepare: dict,
sample_groups: dict,
classes: Optional[List[str]] = None,
points_loader: dict = dict(
type='LoadPointsFromFile',
coord_type='LIDAR',
load_dim=4,
use_dim=[0, 1, 2, 3]),
file_client_args: dict = dict(backend='disk')
) -> None:
super().__init__()
self.data_root = data_root
self.info_path = info_path
......@@ -304,9 +306,7 @@ class DataBaseSampler(object):
return ret
def sample_class_v2(self,
name: str,
num: int,
def sample_class_v2(self, name: str, num: int,
gt_bboxes: np.ndarray) -> List[dict]:
"""Sampling specific categories of bounding boxes.
......
......@@ -72,7 +72,8 @@ class Pack3DDetInputs(BaseTransform):
'sample_idx', 'pcd_scale_factor', 'pcd_rotation',
'pcd_rotation_angle', 'lidar_path',
'transformation_3d_flow', 'trans_mat',
'affine_aug')) -> None:
'affine_aug')
) -> None:
self.keys = keys
self.meta_keys = meta_keys
......
......@@ -25,11 +25,9 @@ class LoadMultiViewImageFromFiles(BaseTransform):
Defaults to 'unchanged'.
"""
def __init__(
self,
to_float32: bool = False,
color_type: str = 'unchanged'
) -> None:
def __init__(self,
to_float32: bool = False,
color_type: str = 'unchanged') -> None:
self.to_float32 = to_float32
self.color_type = color_type
......@@ -154,16 +152,14 @@ class LoadPointsFromMultiSweeps(BaseTransform):
Defaults to False.
"""
def __init__(
self,
sweeps_num: int = 10,
load_dim: int = 5,
use_dim: List[int] = [0, 1, 2, 4],
file_client_args: dict = dict(backend='disk'),
pad_empty_sweeps: bool = False,
remove_close: bool = False,
test_mode: bool = False
) -> None:
def __init__(self,
sweeps_num: int = 10,
load_dim: int = 5,
use_dim: List[int] = [0, 1, 2, 4],
file_client_args: dict = dict(backend='disk'),
pad_empty_sweeps: bool = False,
remove_close: bool = False,
test_mode: bool = False) -> None:
self.load_dim = load_dim
self.sweeps_num = sweeps_num
self.use_dim = use_dim
......@@ -195,11 +191,9 @@ class LoadPointsFromMultiSweeps(BaseTransform):
points = np.fromfile(pts_filename, dtype=np.float32)
return points
def _remove_close(
self,
points: Union[np.ndarray, BasePoints],
radius: float = 1.0
) -> Union[np.ndarray, BasePoints]:
def _remove_close(self,
points: Union[np.ndarray, BasePoints],
radius: float = 1.0) -> Union[np.ndarray, BasePoints]:
"""Removes point too close within a certain radius from origin.
Args:
......
......@@ -46,7 +46,7 @@ class MultiScaleFlipAug3D(BaseTransform):
self.img_scale = img_scale if isinstance(img_scale,
list) else [img_scale]
self.pts_scale_ratio = pts_scale_ratio \
if isinstance(pts_scale_ratio, list) else[float(pts_scale_ratio)]
if isinstance(pts_scale_ratio, list) else [float(pts_scale_ratio)]
assert mmengine.is_list_of(self.img_scale, tuple)
assert mmengine.is_list_of(self.pts_scale_ratio, float)
......
......@@ -1221,10 +1221,8 @@ class IndoorPatchPointSample(BaseTransform):
return points
def _patch_points_sampling(
self,
points: BasePoints,
sem_mask: np.ndarray
) -> Tuple[BasePoints, np.ndarray]:
self, points: BasePoints,
sem_mask: np.ndarray) -> Tuple[BasePoints, np.ndarray]:
"""Patch points sampling.
First sample a valid patch.
......@@ -1470,9 +1468,7 @@ class VoxelBasedPointSampler(BaseTransform):
self.prev_voxel_generator = None
self.prev_voxel_num = 0
def _sample_points(self,
points: np.ndarray,
sampler: VoxelGenerator,
def _sample_points(self, points: np.ndarray, sampler: VoxelGenerator,
point_dim: int) -> np.ndarray:
"""Sample points for each points subset.
......
......@@ -92,7 +92,7 @@ def build_segmentor(cfg, train_cfg=None, test_cfg=None):
def build_model(cfg, train_cfg=None, test_cfg=None):
"""A function warpper for building 3D detector or segmentor according to
"""A function wrapper for building 3D detector or segmentor according to
cfg.
Should be deprecated in the future.
......
......@@ -10,7 +10,8 @@ from .voxelnet import VoxelNet
@MODELS.register_module()
class DynamicVoxelNet(VoxelNet):
r"""VoxelNet using `dynamic voxelization <https://arxiv.org/abs/1910.06528>`_.
r"""VoxelNet using `dynamic voxelization
<https://arxiv.org/abs/1910.06528>`_.
"""
def __init__(self,
......
......@@ -6,7 +6,7 @@ from torch import nn as nn
@MODELS.register_module()
class GroupFree3DMHA(MultiheadAttention):
"""A warpper for torch.nn.MultiheadAttention for GroupFree3D.
"""A wrapper for torch.nn.MultiheadAttention for GroupFree3D.
This module implements MultiheadAttention with identity connection,
and positional encoding used in DETR is also passed as input.
......
......@@ -278,7 +278,7 @@ class SparseEncoderSASSD(SparseEncoder):
Returns:
dict: Backbone features.
tuple[torch.Tensor]: Mean feature value of the points,
Classificaion result of the points,
Classification result of the points,
Regression offsets of the points.
"""
coors = coors.int()
......@@ -409,7 +409,7 @@ class SparseEncoderSASSD(SparseEncoder):
Args:
points (torch.Tensor): Mean feature value of the points.
point_cls (torch.Tensor): Classificaion result of the points.
point_cls (torch.Tensor): Classification result of the points.
point_reg (torch.Tensor): Regression offsets of the points.
gt_bboxes (list[:obj:`BaseInstance3DBoxes`]): Ground truth
boxes for each sample.
......
......@@ -13,4 +13,4 @@ no_lines_before = STDLIB,LOCALFOLDER
default_section = THIRDPARTY
[codespell]
ignore-words-list = ans,refridgerator,crate,hist,formating,dout,wan,nd,fo,avod,AVOD
ignore-words-list = ans,refridgerator,crate,hist,formating,dout,wan,nd,fo,avod,AVOD,warmup
......@@ -566,7 +566,7 @@ def test_lidar_boxes3d():
def test_boxes_conversion():
"""Test the conversion of boxes between different modes.
ComandLine:
CommandLine:
xdoctest tests/test_box3d.py::test_boxes_conversion zero
"""
lidar_boxes = LiDARInstance3DBoxes(
......@@ -1121,7 +1121,7 @@ def test_camera_boxes3d():
def test_boxes3d_overlaps():
"""Test the iou calculation of boxes in different modes.
ComandLine:
CommandLine:
xdoctest tests/test_box3d.py::test_boxes3d_overlaps zero
"""
if not torch.cuda.is_available():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment