diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5156e9c..fdce5f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,27 +1,25 @@ name: build -on: [push, pull_request] +on: + push: + paths-ignore: + - 'README.md' + - 'README_zh-CN.md' + - 'docs/**' + - 'docs_zh-CN/**' + - 'examples/**' + - '.dev_scripts/**' -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.7 - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - name: Install pre-commit hook - run: | - pip install pre-commit - pre-commit install - - name: Linting - run: pre-commit run --all-files - - name: Check docstring coverage - run: | - pip install interrogate - interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmfewshot + pull_request: + paths-ignore: + - 'README.md' + - 'README_zh-CN.md' + - 'docs/**' + - 'docs_zh-CN/**' + - 'examples/**' + - '.dev_scripts/**' +jobs: build_cpu: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1183aeb --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.7 + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Install pre-commit hook + run: | + # markdownlint requires ruby >= 2.7 + sudo apt-add-repository ppa:brightbox/ruby-ng -y + sudo apt-get update + sudo apt-get install -y ruby2.7 + pip install pre-commit + pre-commit install + - name: Linting + run: pre-commit run --all-files + - name: Check docstring coverage + run: | + pip install interrogate + interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmfewshot diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3dfbed3..3a03e19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,8 +28,8 @@ repos: args: ["--remove"] - id: mixed-line-ending args: ["--fix=lf"] - - repo: https://github.com/jumanjihouse/pre-commit-hooks - rev: 2.1.4 + - repo: https://github.com/markdownlint/markdownlint + rev: v0.11.0 hooks: - id: markdownlint args: ["-r", "~MD002,~MD013,~MD024,~MD029,~MD033,~MD034,~MD036", "-t", "allow_different_nesting"] diff --git a/README.md b/README.md index 184b2aa..0aea2b5 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ This project is released under the [Apache 2.0 license](LICENSE). Supported algorithms:
-classification +Classification - [x] [Baseline](configs/classification/baseline/README.md) (ICLR'2019) - [x] [Baseline++](configs/classification/baseline_plus/README.md) (ICLR'2019) @@ -146,3 +146,4 @@ mmfewshot is an open source project that is contributed by researchers and engin - [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab image and video generative models toolbox. - [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab optical flow toolbox and benchmark. - [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab FewShot Learning Toolbox and Benchmark. +- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 3D Human Parametric Model Toolbox and Benchmark. diff --git a/README_zh-CN.md b/README_zh-CN.md index a78d08c..18e6a0d 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -7,6 +7,7 @@ ## Introduction [English](README.md) | 简体中文 + [![Documentation](https://readthedocs.org/projects/mmfewshot/badge/?version=latest)](https://mmfewshot.readthedocs.io/en/latest/?badge=latest) [![actions](https://github.com/open-mmlab/mmfewshot/workflows/build/badge.svg)](https://github.com/open-mmlab/mmfewshot/actions) [![codecov](https://codecov.io/gh/open-mmlab/mmfewshot/branch/main/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmfewshot) @@ -145,6 +146,7 @@ MMFewShot 是一款由不同学校和公司共同贡献的开源项目。我们 - [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab 新一代生成模型工具箱 - [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab 光流估计工具箱与测试基准 - [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab 少样本学习工具箱与测试基准 +- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 人体参数化模型工具箱与测试基准 ## 欢迎加入 OpenMMLab 社区 diff --git a/docs/conf.py b/docs/conf.py index 7b133a5..42d011a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -146,6 +146,10 @@ def get_version(): 'name': 'MMFewShot', 'url': 'https://mmfewshot.readthedocs.io/en/latest/', }, + { + 'name': 'MMHuman3D', + 'url': 'https://github.com/open-mmlab/mmhuman3d', + }, ] }, { diff --git a/docs/install.md b/docs/install.md index ae6a8f5..bc3d84a 100644 --- a/docs/install.md +++ b/docs/install.md @@ -5,9 +5,9 @@ - PyTorch 1.5+ - CUDA 9.2+ - GCC 5+ -- [mmcv](https://mmcv.readthedocs.io/en/latest/#installation) 1.3.12+ -- [mmdet](https://mmdetection.readthedocs.io/en/latest/#installation) 2.16.0+ -- [mmcls](https://mmclassification.readthedocs.io/en/latest/#installation) 0.15.0+ +- [mmcv](https://mmcv.readthedocs.io/en/latest/get_started/installation.html) 1.3.12+ +- [mmdet](https://mmdetection.readthedocs.io/en/latest/get_started.html#installation) 2.16.0+ +- [mmcls](https://mmclassification.readthedocs.io/en/latest/install.html) 0.15.0+ Compatible MMCV, MMClassification and MMDetection versions are shown as below. Please install the correct version of them to avoid installation issues. diff --git a/docs_zh-CN/conf.py b/docs_zh-CN/conf.py index 5ccf800..4ce82c6 100644 --- a/docs_zh-CN/conf.py +++ b/docs_zh-CN/conf.py @@ -87,11 +87,11 @@ def get_version(): }, { 'name': - 'Docs', + '文档', 'children': [ { 'name': 'MMCV', - 'url': 'https://mmcv.readthedocs.io/en/latest/', + 'url': 'https://mmcv.readthedocs.io/zh_CN/latest/', }, { 'name': 'MIM', @@ -99,24 +99,25 @@ def get_version(): }, { 'name': 'MMAction2', - 'url': 'https://mmaction2.readthedocs.io/en/latest/', + 'url': 'https://mmaction2.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMClassification', 'url': - 'https://mmclassification.readthedocs.io/en/latest/', + 'https://mmclassification.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMDetection', - 'url': 'https://mmdetection.readthedocs.io/en/latest/', + 'url': 'https://mmdetection.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMDetection3D', - 'url': 'https://mmdetection3d.readthedocs.io/en/latest/', + 'url': + 'https://mmdetection3d.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMEditing', - 'url': 'https://mmediting.readthedocs.io/en/latest/', + 'url': 'https://mmediting.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMGeneration', @@ -124,19 +125,20 @@ def get_version(): }, { 'name': 'MMOCR', - 'url': 'https://mmocr.readthedocs.io/en/latest/', + 'url': 'https://mmocr.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMPose', - 'url': 'https://mmpose.readthedocs.io/en/latest/', + 'url': 'https://mmpose.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMSegmentation', - 'url': 'https://mmsegmentation.readthedocs.io/en/latest/', + 'url': + 'https://mmsegmentation.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMTracking', - 'url': 'https://mmtracking.readthedocs.io/en/latest/', + 'url': 'https://mmtracking.readthedocs.io/zh_CN/latest/', }, { 'name': 'MMFlow', @@ -144,7 +146,11 @@ def get_version(): }, { 'name': 'MMFewShot', - 'url': 'https://mmfewshot.readthedocs.io/en/latest/', + 'url': 'https://mmfewshot.readthedocs.io/zh_CN/latest/', + }, + { + 'name': 'MMHuman3D', + 'url': 'https://github.com/open-mmlab/mmhuman3d', }, ] }, diff --git a/setup.py b/setup.py index 34fc8a7..10a6593 100755 --- a/setup.py +++ b/setup.py @@ -139,8 +139,20 @@ def add_mim_extension(): if mode == 'symlink': src_relpath = osp.relpath(src_path, osp.dirname(tar_path)) - os.symlink(src_relpath, tar_path) - elif mode == 'copy': + try: + os.symlink(src_relpath, tar_path) + except OSError: + # Creating a symbolic link on windows may raise an + # `OSError: [WinError 1314]` due to privilege. If + # the error happens, the src file will be copied + mode = 'copy' + warnings.warn( + f'Failed to create a symbolic link for {src_relpath}, ' + f'and it will be copied to {tar_path}') + else: + continue + + if mode == 'copy': if osp.isfile(src_path): shutil.copyfile(src_path, tar_path) elif osp.isdir(src_path):