Some pre-commit hooks for OpenMMLab projects

Overview

pre-commit-hooks

Some pre-commit hooks for OpenMMLab projects.

Using pre-commit-hooks with pre-commit

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/open-mmlab/pre-commit-hooks
    rev: v0.1.0  # Use the ref you want to point at
    hooks:
    -   id: check-algo-readme
    -   id: check-copyright
        args: ["dir_to_check"]  # replace the dir_to_check with your expected directory to check

Hooks available

say-hello

A template to show how to implement a pre-commit hook

check-algo-readme

Check whether the abstract and icon exist in the algorithm readme.

  • --debug - print details of abstract and icon in dict format.
  • --dry-run - just dry run, igonre failed use case.
  • --model-index ${MODEL_INDEX} - custom model-index file path.

check-copyright

Check whether the code contains copyright

  • includes - directory to add copyright.
  • --excludes - exclude directory.
  • --suffixes - copyright will be added to files with suffix.
You might also like...
FIRA: Fine-Grained Graph-Based Code Change Representation for Automated Commit Message Generation

FIRA is a learning-based commit message generation approach, which first represents code changes via fine-grained graphs and then learns to generate commit messages automatically.

List of all dependencies affected by node-ipc malicious commit
List of all dependencies affected by node-ipc malicious commit

node-ipc-dependencies-list List of all dependencies affected by node-ipc malicious commit as of 17/3/2022 - 19/3/2022 (timestamp) Please improve upon

Checkout some cool self-projects you can try your hands on to curb your boredom this December!

SoC-Winter Checkout some cool self-projects you can try your hands on to curb your boredom this December! These are short projects that you can do you

PyTorch implementation of the Transformer in Post-LN (Post-LayerNorm) and Pre-LN (Pre-LayerNorm).
PyTorch implementation of the Transformer in Post-LN (Post-LayerNorm) and Pre-LN (Pre-LayerNorm).

Transformer-PyTorch A PyTorch implementation of the Transformer from the paper Attention is All You Need in both Post-LN (Post-LayerNorm) and Pre-LN (

Codes to pre-train T5 (Text-to-Text Transfer Transformer) models pre-trained on Japanese web texts

t5-japanese Codes to pre-train T5 (Text-to-Text Transfer Transformer) models pre-trained on Japanese web texts. The following is a list of models that

A Sklearn-like Framework for Hyperparameter Tuning and AutoML in Deep Learning projects. Finally have the right abstractions and design patterns to properly do AutoML. Let your pipeline steps have hyperparameter spaces. Enable checkpoints to cut duplicate calculations. Go from research to production environment easily.
All the essential resources and template code needed to understand and practice data structures and algorithms in python with few small projects to demonstrate their practical application.

Data Structures and Algorithms Python INDEX 1. Resources - Books Data Structures - Reema Thareja competitiveCoding Big-O Cheat Sheet DAA Syllabus Inte

A list of multi-task learning papers and projects.

This page contains a list of papers on multi-task learning for computer vision. Please create a pull request if you wish to add anything. If you are interested, consider reading our recent survey paper.

A list of multi-task learning papers and projects.

A list of multi-task learning papers and projects.

Comments
  • [Feature] Add remove_eol_characters hook

    [Feature] Add remove_eol_characters hook

    This PR adds a new script/pre-commit-hook, named remove-improper-eol-in-cn-docs.

    The script aims at resolving extra whitespaces in Chinese docs, which is a long-standing HTML issue as discussed here.

    To solve the issue, this script finds and removes end_of_line characters which split natural Chinese paragraphs. For example,

    这是一个, 像诗一样的 测试

    will be changed to

    这是一个,像诗一样的测试

    However, the following cases stay unchanged:

    • Docs written in English

    This is, a poem-like test

    • Natural paragraphs (split by 2+ eol characters in Markdown)

    这是一个

    测试

    opened by C1rN09 2
  • Add an option to allow files can not be found

    Add an option to allow files can not be found

    Modify .pre-commit-config.yaml with the following config to test this hook.

      - repo: https://github.com/zhouzaida/pre-commit-hooks-1
        rev: 8dd4395  # Use the ref you want to point at
        hooks:
        -   id: check-copyright
            args: ["dir_to_check", "not-found-dir", "--ignore-file-not-found-error"] 
    
    opened by zhouzaida 0
  • Upgrade the version of isort

    Upgrade the version of isort

    Motivation

    https://github.com/open-mmlab/mmflow/pull/87

    Upgrade the version of isort.

    Modification

    • Remove seed-isort-config in pre-commit hook
    • Upgrade isort to v5.10.1 (latest version)
    • Replace known_standard_library with extra_standard_library
    opened by zhouzaida 0
  • [Feature] Support checking model-index.yml

    [Feature] Support checking model-index.yml

    Modify .pre-commit-config.yaml with the following config to test this hook.

      - repo: https://github.com/zhouzaida/pre-commit-hooks-1
        rev: 0672dd0  # Use the ref you want to point at
        hooks:
          - id: check-model-index
            args: ["model-index.yml"]  # replace the dir_to_check with your expected directory to check
            additional_dependencies:
              - cerberus
    

    In addition, since YAML does not support tuple type, the resolution field in a metafile is recognized as a string, so fix this type to be a list. You can use the following regular expression global replacement in vs code

    • resolution: \(([0-9]*), ([0-9]*)\)
    • resolution: [$1, $2]

    image

    opened by zhouzaida 0
Releases(v0.4.0)
Owner
OpenMMLab
OpenMMLab
OpenMMLab Detection Toolbox and Benchmark

MMDetection is an open source object detection toolbox based on PyTorch. It is a part of the OpenMMLab project.

OpenMMLab 22.5k Jan 5, 2023
OpenMMLab Semantic Segmentation Toolbox and Benchmark.

Documentation: https://mmsegmentation.readthedocs.io/ English | 简体中文 Introduction MMSegmentation is an open source semantic segmentation toolbox based

OpenMMLab 5k Dec 31, 2022
OpenMMLab Image and Video Editing Toolbox

Introduction MMEditing is an open source image and video editing toolbox based on PyTorch. It is a part of the OpenMMLab project. The master branch wo

OpenMMLab 3.9k Jan 4, 2023
OpenMMLab's Next Generation Video Understanding Toolbox and Benchmark

Introduction English | 简体中文 MMAction2 is an open-source toolbox for video understanding based on PyTorch. It is a part of the OpenMMLab project. The m

OpenMMLab 2.7k Jan 7, 2023
OpenMMLab Pose Estimation Toolbox and Benchmark.

Introduction English | 简体中文 MMPose is an open-source toolbox for pose estimation based on PyTorch. It is a part of the OpenMMLab project. The master b

OpenMMLab 2.8k Dec 31, 2022
MIM: MIM Installs OpenMMLab Packages

MIM provides a unified API for launching and installing OpenMMLab projects and their extensions, and managing the OpenMMLab model zoo.

OpenMMLab 254 Jan 4, 2023
OpenMMLab Computer Vision Foundation

English | 简体中文 Introduction MMCV is a foundational library for computer vision research and supports many research projects as below: MMCV: OpenMMLab

OpenMMLab 4.6k Jan 9, 2023
Convert openmmlab (not only mmdetection) series model to tensorrt

MMDet to TensorRT This project aims to convert the mmdetection model to TensorRT model end2end. Focus on object detection for now. Mask support is exp

JinTian 4 Dec 17, 2021
Mmrotate - OpenMMLab Rotated Object Detection Benchmark

OpenMMLab website HOT OpenMMLab platform TRY IT OUT ?? Documentation | ??️ Insta

OpenMMLab 1.2k Jan 4, 2023
An example to implement a new backbone with OpenMMLab framework.

Backbone example on OpenMMLab framework English | 简体中文 Introduction This is an template repo about how to use OpenMMLab framework to develop a new bac

Ma Zerun 22 Dec 29, 2022