[Enhancement] Add open-mmlab precommit hook (#787)

pull/800/head
Tong Gao 2022-02-22 12:52:04 +08:00 committed by GitHub
parent 5582e17feb
commit 91f98bc645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 16 additions and 0 deletions

View File

@ -40,3 +40,9 @@ repos:
hooks:
- id: docformatter
args: ["--in-place", "--wrap-descriptions", "79"]
- repo: https://github.com/open-mmlab/pre-commit-hooks
rev: v0.2.0 # Use the ref you want to point at
hooks:
- id: check-algo-readme
- id: check-copyright
args: ["mmocr", "tests", "tools"] # these directories will be checked

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import copy
import numpy as np

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .single_stage import SingleStageDetector
__all__ = ['SingleStageDetector']

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import warnings
from mmdet.models.detectors import \

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .transformer_layers import TFDecoderLayer, TFEncoderLayer
__all__ = ['TFEncoderLayer', 'TFDecoderLayer']

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .transformer_module import (MultiHeadAttention, PositionalEncoding,
PositionwiseFeedForward,
ScaledDotProductAttention)

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from mmocr.models.builder import POSTPROCESSOR
from .base_postprocessor import BasePostprocessor
from .utils import (clusters2labels, comps2boundaries, connected_components,

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import math
import torch.nn as nn

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from mmocr.models.builder import DETECTORS
from .encode_decode_recognizer import EncodeDecodeRecognizer

View File

@ -1,3 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import json
from functools import partial