Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
AllentDan committed Jan 24, 2022
2 parents 8144262 + eeddd8a commit 18e2899
Show file tree
Hide file tree
Showing 136 changed files with 2,894 additions and 1,028 deletions.
109 changes: 103 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ on:
- 'tools/**'
- 'docs/**'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_cpu:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.7]
torch: [1.8.0]
torch: [1.8.0, 1.9.0]
mmcv: [1.4.0]
include:
- torch: 1.8.0
torchvision: 0.9.0
mmcv: "latest+torch1.8.0+cpu"
- torch: 1.9.0
torchvision: 0.10.0
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -33,18 +39,109 @@ jobs:
run: pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu -f https://download.pytorch.org/whl/torch_stable.html
- name: Install MMCV
run: |
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html
pip install mmcv-full==${{matrix.mmcv}} -f https://download.openmmlab.com/mmcv/dist/cpu/torch${{matrix.torch}}/index.html
python -c 'import mmcv; print(mmcv.__version__)'
- name: Install unittest dependencies
run: |
pip install -r requirements.txt
DIR=$(pip show mmocr | grep Location)
DIR=${DIR:10}
sed -i "s/1.4.0/1.5.0/" $(find $DIR/ -path "*mmocr/__init__.py")
- name: Build and install
run: rm -rf .eggs && pip install -e .
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmdeploy -m pytest -rsE tests/
coverage xml
coverage report -m
build_cuda102:
runs-on: ubuntu-18.04
container:
image: pytorch/pytorch:1.9.0-cuda10.2-cudnn7-devel
env:
FORCE_CUDA: 1
strategy:
matrix:
python-version: [3.7]
torch: [1.9.0+cu102]
mmcv: [1.4.0]
include:
- torch: 1.9.0+cu102
torch_version: torch1.9.0
torchvision: 0.10.0+cu102
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev python${{matrix.python-version}}-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Install PyTorch
run: python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
python -V
python -m pip install mmcv-full==${{matrix.mmcv}} -f https://download.openmmlab.com/mmcv/dist/cu102/${{matrix.torch_version}}/index.html
python -m pip install -r requirements.txt
- name: Build and install
run: |
rm -rf .eggs && python -m pip install -e .
python tools/check_env.py
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmdeploy -m pytest -rsE tests/
coverage xml
coverage report -m
build_cuda111:
runs-on: ubuntu-18.04
container:
image: pytorch/pytorch:1.8.0-cuda11.1-cudnn8-devel

strategy:
matrix:
python-version: [3.7]
torch: [1.8.0+cu111]
mmcv: [1.4.0]
include:
- torch: 1.8.0+cu111
torch_version: torch1.8.0
torchvision: 0.9.0+cu111

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies
run: |
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev python${{matrix.python-version}}-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
- name: Install PyTorch
run: python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
python -V
python -m pip install mmcv-full==${{matrix.mmcv}} -f https://download.openmmlab.com/mmcv/dist/cu111/${{matrix.torch_version}}/index.html
python -m pip install -r requirements.txt
- name: Build and install
run: |
rm -rf .eggs && python -m pip install -e .
python tools/check_env.py
- name: Run unittests and generate coverage report
run: |
coverage run --branch --source mmdeploy -m pytest -rsE tests/
coverage xml
coverage report -m
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Check docstring coverage
run: |
pip install interrogate
interrogate -v --ignore-init-method --ignore-module --ignore-private --ignore-nested-functions --ignore-nested-classes --ignore-regex "DeployBase*" --fail-under 95 mmdeploy
interrogate -v --ignore-init-method --ignore-module --ignore-private --ignore-nested-functions --ignore-nested-classes --fail-under 95 mmdeploy
- name: Check pylint score
run: |
pip install pylint
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[settings]
known_third_party = h5py,m2r,mmcls,mmcv,mmdet,mmedit,mmocr,mmseg,ncnn,numpy,onnx,onnxruntime,packaging,pyppeteer,pyppl,pytest,pytorch_sphinx_theme,recommonmark,setuptools,sphinx,tensorrt,torch,torchvision
known_third_party = h5py,m2r,mmcls,mmcv,mmdeploy_python,mmdet,mmedit,mmocr,mmseg,ncnn,numpy,onnx,onnxruntime,packaging,pyppeteer,pyppl,pytest,pytorch_sphinx_theme,recommonmark,setuptools,sphinx,tensorrt,torch,torchvision
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.8.3
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/asottile/seed-isort-config
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ formats: all
python:
version: 3.7
install:
- requirements: requirements/runtime.txt
- requirements: requirements/docs.txt
- requirements: requirements/readthedocs.txt
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ if (MMDEPLOY_BUILD_SDK)
add_subdirectory(tests/test_csrc)
endif ()

if (MMDEPLOY_BUILD_SDK_PYTHON_API)
add_subdirectory(csrc/apis/python)
endif()

# export MMDeploy package
install(EXPORT MMDeployTargets
# NAMESPACE mmdeploy::
Expand Down
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<div align="center">
<img src="resources/mmdeploy-logo.png" width="450"/>
<div>&nbsp;</div>
<div align="center">
<b><font size="5">OpenMMLab website</font></b>
<sup>
<a href="https://openmmlab.com">
<i><font size="4">HOT</font></i>
</a>
</sup>
&nbsp;&nbsp;&nbsp;&nbsp;
<b><font size="5">OpenMMLab platform</font></b>
<sup>
<a href="https://platform.openmmlab.com">
<i><font size="4">TRY IT OUT</font></i>
</a>
</sup>
</div>
<div>&nbsp;</div>
</div>

[![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmdeploy.readthedocs.io/en/latest/)
Expand Down Expand Up @@ -49,33 +66,34 @@ a part of the [OpenMMLab](https://openmmlab.com/) project.

This project is released under the [Apache 2.0 license](LICENSE).


## Installation

Please refer to [build.md](docs/en/build.md) for installation.
Please refer to [build.md](https://mmdeploy.readthedocs.io/en/latest/build.html) for installation.

## Getting Started
Please see [getting_started.md](docs/en/get_started.md) for the basic usage of MMDeploy. We also provide other tutorials for:
- [how to convert model](docs/en/tutorials/how_to_convert_model.md)
- [how to write config](docs/en/tutorials/how_to_write_config.md)
- [how to support new models](docs/en/tutorials/how_to_support_new_models.md)
- [how to measure performance of models](docs/en/tutorials/how_to_measure_performance_of_models.md)

Please see [getting_started.md](https://mmdeploy.readthedocs.io/en/latest/get_started.html) for the basic usage of MMDeploy. We also provide other tutorials for:

Please refer to [FAQ](docs/en/faq.md) for frequently asked questions.
- [how to convert model](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_convert_model.html)
- [how to write config](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_write_config.html)
- [how to support new models](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_support_new_models.html)
- [how to measure performance of models](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_measure_performance_of_models.html)

Please refer to [FAQ](https://mmdeploy.readthedocs.io/en/latest/faq.html) for frequently asked questions.

## Benchmark and model zoo

Results and supported model list are available in the [benchmark](docs/en/benchmark.md) and [model list](docs/en/supported_models.md).
Results and supported model list are available in the [benchmark](https://mmdeploy.readthedocs.io/en/latest/benchmark.html) and [model list](https://mmdeploy.readthedocs.io/en/latest/supported_models.html).

## Contributing

We appreciate all contributions to improve MMDeploy. Please refer to [CONTRIBUTING.md](.github/CONTRIBUTING.md) for the contributing guideline.

## Acknowledgement

We would like to thank OpenVINO team, for their remarkable efforts to export MMDetection models to OpenVINO and integrate OpenVINO into MMDeploy backends
We would like to sincerely thank the following teams for their contributions to [MMDeploy](https://github.com/open-mmlab/mmdeploy):
- [OpenPPL](https://github.com/openppl-public)
- [OpenVINO](https://github.com/openvinotoolkit/openvino)

## Citation

Expand Down Expand Up @@ -109,3 +127,4 @@ If you find this project useful in your research, please consider cite:
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab Human Pose and Shape Estimation Toolbox and Benchmark.
- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab self-supervised learning Toolbox and Benchmark.
- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab Model Compression Toolbox and Benchmark.
- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab Model Deployment Framework.
40 changes: 30 additions & 10 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<div align="center">
<img src="resources/mmdeploy-logo.png" width="450"/>
<div>&nbsp;</div>
<div align="center">
<b><font size="5">OpenMMLab 官网</font></b>
<sup>
<a href="https://openmmlab.com">
<i><font size="4">HOT</font></i>
</a>
</sup>
&nbsp;&nbsp;&nbsp;&nbsp;
<b><font size="5">OpenMMLab 开放平台</font></b>
<sup>
<a href="https://platform.openmmlab.com">
<i><font size="4">TRY IT OUT</font></i>
</a>
</sup>
</div>
<div>&nbsp;</div>
</div>

[![docs](https://img.shields.io/badge/docs-latest-blue)](https://mmdeploy.readthedocs.io/en/latest/)
Expand Down Expand Up @@ -47,33 +64,35 @@ MMDeploy 是一个开源深度学习模型部署工具箱,它是 [OpenMMLab](h

该项目采用 [Apache 2.0 开源许可证](LICENSE)


## 安装

请参考[构建项目](docs/zh_cn/build.md)进行安装。
请参考[构建项目](https://mmdeploy.readthedocs.io/zh_CN/latest/build.html)进行安装。

## 快速入门

请参考[快速入门文档](docs/zh_cn/get_started.md)学习 MMDeploy 的基本用法。我们还提供了一些进阶教程,
请参考[快速入门文档](https://mmdeploy.readthedocs.io/zh_CN/latest/get_started.html)学习 MMDeploy 的基本用法。我们还提供了一些进阶教程,

- [如何进行模型转换](docs/en/tutorials/how_to_convert_model.md)
- [如何编写配置文件](docs/en/tutorials/how_to_write_config.md)
- [如何支持新模型](docs/en/tutorials/how_to_support_new_models.md)
- [如何测试模型效果](docs/en/tutorials/how_to_measure_performance_of_models.md)
- [如何进行模型转换](https://mmdeploy.readthedocs.io/zh_CN/latest/tutorials/how_to_convert_model.html)
- [如何编写配置文件](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_write_config.html)
- [如何支持新模型](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_support_new_models.html)
- [如何测试模型效果](https://mmdeploy.readthedocs.io/en/latest/tutorials/how_to_measure_performance_of_models.html)

如果遇到问题,请参考 [常见问题解答](docs/zh_cn/faq.md)
如果遇到问题,请参考 [常见问题解答](https://mmdeploy.readthedocs.io/zh_CN/latest/faq.html)

## 基准与模型库

基准和支持的模型列表可以在[基准](docs/zh_cn/benchmark.md)[模型列表](docs/en/supported_models.md)中获得。
基准和支持的模型列表可以在[基准](https://mmdeploy.readthedocs.io/zh_CN/latest/benchmark.html)[模型列表](https://mmdeploy.readthedocs.io/en/latest/supported_models.html)中获得。

## 贡献指南

我们感谢所有的贡献者为改进和提升 MMDeploy 所作出的努力。请参考[贡献指南](.github/CONTRIBUTING.md)来了解参与项目贡献的相关指引。

## 致谢

OpenVINO团队在MMDeploy中添加了OpenVINO部署后端,并开发了MMDetection在OpenVINO下的部署功能,为MMDeploy做出了重大贡献。对此我们表示衷心的感谢。
由衷感谢以下团队为 [MMDeploy](https://github.com/open-mmlab/mmdeploy) 做出的贡献:

- [OpenPPL](https://github.com/openppl-public)
- [OpenVINO](https://github.com/openvinotoolkit/openvino)

## 引用

Expand Down Expand Up @@ -107,6 +126,7 @@ OpenVINO团队在MMDeploy中添加了OpenVINO部署后端,并开发了MMDetect
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab 人体参数化模型工具箱与测试基准
- [MMSelfSup](https://github.com/open-mmlab/mmselfsup): OpenMMLab 自监督学习工具箱与测试基准
- [MMRazor](https://github.com/open-mmlab/mmrazor): OpenMMLab 模型压缩工具箱与测试基准
- [MMDeploy](https://github.com/open-mmlab/mmdeploy): OpenMMLab 模型部署框架

## 欢迎加入 OpenMMLab 社区

Expand Down
1 change: 1 addition & 0 deletions configs/_base_/backends/sdk.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
backend_config = dict(type='sdk')
8 changes: 8 additions & 0 deletions configs/mmcls/classification_sdk_dynamic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_base_ = ['./classification_dynamic.py', '../_base_/backends/sdk.py']

codebase_config = dict(model_type='sdk')

backend_config = dict(pipeline=[
dict(type='LoadImageFromFile'),
dict(type='Collect', keys=['img'], meta_keys=['filename', 'ori_shape'])
])
8 changes: 8 additions & 0 deletions configs/mmdet/detection/detection_sdk_dynamic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_base_ = ['../_base_/base_dynamic.py', '../../_base_/backends/sdk.py']

codebase_config = dict(model_type='sdk')

backend_config = dict(pipeline=[
dict(type='LoadImageFromFile'),
dict(type='Collect', keys=['img'], meta_keys=['filename', 'ori_shape'])
])
4 changes: 4 additions & 0 deletions configs/mmdet/detection/single-stage_ncnn_static-416x416.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
_base_ = ['../_base_/base_static.py', '../../_base_/backends/ncnn.py']

codebase_config = dict(model_type='ncnn_end2end')
onnx_config = dict(output_names=['detection_output'], input_shape=[416, 416])
3 changes: 0 additions & 3 deletions configs/mmdet/detection/single-stage_partition_ncnn_static.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 18e2899

Please sign in to comment.