From 58bcdaea772cf8157ee6041dced8596de3dfc430 Mon Sep 17 00:00:00 2001 From: RunningLeon Date: Wed, 12 Apr 2023 11:55:03 +0800 Subject: [PATCH] Fix retinanet wrong visualization with torch1.13+openvino (#1977) * fix * fix ci * fix dead links --- .circleci/test.yml | 4 ++-- .github/workflows/backend-ort.yml | 2 +- .github/workflows/build.yml | 8 ++++---- docs/en/04-supported-codebases/mmaction2.md | 10 +++++----- docs/en/04-supported-codebases/mmocr.md | 2 +- docs/en/07-developer-guide/architecture.md | 2 +- docs/zh_cn/04-supported-codebases/mmaction2.md | 10 +++++----- docs/zh_cn/04-supported-codebases/mmocr.md | 2 +- docs/zh_cn/07-developer-guide/architecture.md | 2 +- .../task_modules/coders/delta_xywh_bbox_coder.py | 5 +++-- 10 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.circleci/test.yml b/.circleci/test.yml index a94dcb4d74..e831dae22f 100644 --- a/.circleci/test.yml +++ b/.circleci/test.yml @@ -85,7 +85,7 @@ commands: cd mmdeploy python -m mim install -r requirements/codebases.txt python -m pip install -r requirements.txt - python -m pip install -U numpy clip numba + python -m pip install -U numpy clip numba transformers cd .. perform_model_converter_ut: steps: @@ -145,7 +145,7 @@ jobs: docker exec mmdeploy pip install onnxruntime==1.8.1 docker exec mmdeploy mim install -r mmdeploy/requirements/codebases.txt docker exec mmdeploy pip install -r mmdeploy/requirements.txt - docker exec mmdeploy pip install -U numpy clip numba + docker exec mmdeploy pip install -U numpy clip numba transformers - run: name: Perform Model Converter unittests command: | diff --git a/.github/workflows/backend-ort.yml b/.github/workflows/backend-ort.yml index d296270c7b..a21eeaee5c 100644 --- a/.github/workflows/backend-ort.yml +++ b/.github/workflows/backend-ort.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true jobs: - buils_ort: + build_ort: runs-on: ubuntu-20.04 strategy: matrix: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14f05e3a7e..b19f2c2731 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: python -m pip install -r requirements/backends.txt python -m mim install "mmcv>=2.0.0rc1" python -m mim install -r requirements/codebases.txt - python -m pip install -U numpy clip numba + python -m pip install -U numpy clip numba transformers python -m pip list - name: Install mmyolo run: | @@ -149,7 +149,7 @@ jobs: python -m pip install -r requirements/backends.txt python -m mim install "mmcv>=2.0.0rc1" CFLAGS=$CFLAGS python -m mim install -r requirements/codebases.txt - python -m pip install -U pycuda numpy clip numba + python -m pip install -U pycuda numpy clip numba transformers python -m pip list - name: Build and install run: | @@ -194,7 +194,7 @@ jobs: python -m pip install -r requirements/backends.txt python -m mim install "mmcv>=2.0.0rc1" python -m mim install -r requirements/codebases.txt - python -m pip install -U pycuda numpy clip numba + python -m pip install -U pycuda numpy clip numba transformers python -m pip list - name: Build and install run: | @@ -232,7 +232,7 @@ jobs: apt update && apt install unzip python3 -V python3 -m pip install opencv-python==4.5.4.60 opencv-python-headless==4.5.4.60 opencv-contrib-python==4.5.4.60 - python3 -m pip install openmim numpy pycuda clip + python3 -m pip install openmim numpy pycuda clip transformers python3 -m pip install -r requirements.txt python3 -m mim install $(cat requirements/codebases.txt | grep mmcls) python3 -m pip list diff --git a/docs/en/04-supported-codebases/mmaction2.md b/docs/en/04-supported-codebases/mmaction2.md index f33ffdfe4d..8f0d5a04e2 100644 --- a/docs/en/04-supported-codebases/mmaction2.md +++ b/docs/en/04-supported-codebases/mmaction2.md @@ -21,7 +21,7 @@ ______________________________________________________________________ ### Install mmaction2 -Please follow the [installation guide](https://github.com/open-mmlab/mmaction2/tree/1.x#installation) to install mmaction2. +Please follow the [installation guide](https://github.com/open-mmlab/mmaction2/tree/main#installation) to install mmaction2. ### Install mmdeploy @@ -184,7 +184,7 @@ Besides python API, mmdeploy SDK also provides other FFI (Foreign Function Inter ## Supported models -| Model | TorchScript | ONNX Runtime | TensorRT | ncnn | PPLNN | OpenVINO | -| :---------------------------------------------------------------------------------------- | :---------: | :----------: | :------: | :--: | :---: | :------: | -| [TSN](https://github.com/open-mmlab/mmaction2/tree/1.x/configs/recognition/tsn) | N | Y | Y | N | N | N | -| [SlowFast](https://github.com/open-mmlab/mmaction2/tree/1.x/configs/recognition/slowfast) | N | Y | Y | N | N | N | +| Model | TorchScript | ONNX Runtime | TensorRT | ncnn | PPLNN | OpenVINO | +| :----------------------------------------------------------------------------------------- | :---------: | :----------: | :------: | :--: | :---: | :------: | +| [TSN](https://github.com/open-mmlab/mmaction2/tree/main/configs/recognition/tsn) | N | Y | Y | N | N | N | +| [SlowFast](https://github.com/open-mmlab/mmaction2/tree/main/configs/recognition/slowfast) | N | Y | Y | N | N | N | diff --git a/docs/en/04-supported-codebases/mmocr.md b/docs/en/04-supported-codebases/mmocr.md index 447aae7fee..e964ab740d 100644 --- a/docs/en/04-supported-codebases/mmocr.md +++ b/docs/en/04-supported-codebases/mmocr.md @@ -24,7 +24,7 @@ ______________________________________________________________________ ### Install mmocr -Please follow the [installation guide](https://mmocr.readthedocs.io/en/latest/install.html) to install mmocr. +Please follow the [installation guide](https://mmocr.readthedocs.io/en/latest/get_started/install.html) to install mmocr. ### Install mmdeploy diff --git a/docs/en/07-developer-guide/architecture.md b/docs/en/07-developer-guide/architecture.md index 0123bebe72..d96f95c05b 100644 --- a/docs/en/07-developer-guide/architecture.md +++ b/docs/en/07-developer-guide/architecture.md @@ -93,7 +93,7 @@ Operators customized for ncnn are in the `csrc/mmdeploy/backend_ops/ncnn/` direc - topk - tensorslice -- shpe +- shape - gather - expand - constantofshape diff --git a/docs/zh_cn/04-supported-codebases/mmaction2.md b/docs/zh_cn/04-supported-codebases/mmaction2.md index f1a42307e7..3e7916ff85 100644 --- a/docs/zh_cn/04-supported-codebases/mmaction2.md +++ b/docs/zh_cn/04-supported-codebases/mmaction2.md @@ -21,7 +21,7 @@ ______________________________________________________________________ ### 安装 mmaction2 -请参考[官网安装指南](https://github.com/open-mmlab/mmaction2/tree/1.x#installation). +请参考[官网安装指南](https://github.com/open-mmlab/mmaction2/tree/main#installation). ### 安装 mmdeploy @@ -187,7 +187,7 @@ for label_id, score in result: ## 模型支持列表 -| Model | TorchScript | ONNX Runtime | TensorRT | ncnn | PPLNN | OpenVINO | -| :---------------------------------------------------------------------------------------- | :---------: | :----------: | :------: | :--: | :---: | :------: | -| [TSN](https://github.com/open-mmlab/mmaction2/tree/1.x/configs/recognition/tsn) | N | Y | Y | N | N | N | -| [SlowFast](https://github.com/open-mmlab/mmaction2/tree/1.x/configs/recognition/slowfast) | N | Y | Y | N | N | N | +| Model | TorchScript | ONNX Runtime | TensorRT | ncnn | PPLNN | OpenVINO | +| :----------------------------------------------------------------------------------------- | :---------: | :----------: | :------: | :--: | :---: | :------: | +| [TSN](https://github.com/open-mmlab/mmaction2/tree/main/configs/recognition/tsn) | N | Y | Y | N | N | N | +| [SlowFast](https://github.com/open-mmlab/mmaction2/tree/main/configs/recognition/slowfast) | N | Y | Y | N | N | N | diff --git a/docs/zh_cn/04-supported-codebases/mmocr.md b/docs/zh_cn/04-supported-codebases/mmocr.md index dc6762131c..8dd1798ee8 100644 --- a/docs/zh_cn/04-supported-codebases/mmocr.md +++ b/docs/zh_cn/04-supported-codebases/mmocr.md @@ -24,7 +24,7 @@ ______________________________________________________________________ ### 安装 mmocr -请参考[官网安装指南](https://mmocr.readthedocs.io/en/latest/install.html). +请参考[官网安装指南](https://mmocr.readthedocs.io/en/latest/get_started/install.html). ### 安装 mmdeploy diff --git a/docs/zh_cn/07-developer-guide/architecture.md b/docs/zh_cn/07-developer-guide/architecture.md index 125ac28232..184d19421d 100644 --- a/docs/zh_cn/07-developer-guide/architecture.md +++ b/docs/zh_cn/07-developer-guide/architecture.md @@ -93,7 +93,7 @@ $ tree -L 1 - topk - tensorslice -- shpe +- shape - gather - expand - constantofshape diff --git a/mmdeploy/codebase/mmdet/models/task_modules/coders/delta_xywh_bbox_coder.py b/mmdeploy/codebase/mmdet/models/task_modules/coders/delta_xywh_bbox_coder.py index 8a53944233..243c0dcaed 100644 --- a/mmdeploy/codebase/mmdet/models/task_modules/coders/delta_xywh_bbox_coder.py +++ b/mmdeploy/codebase/mmdet/models/task_modules/coders/delta_xywh_bbox_coder.py @@ -101,8 +101,9 @@ def delta2bbox(rois, dxy = denorm_deltas[..., :2] dwh = denorm_deltas[..., 2:] - xy1 = rois[..., None, :2] - xy2 = rois[..., None, 2:] + # fix openvino on torch1.13 + xy1 = rois[..., :2].unsqueeze(2) + xy2 = rois[..., 2:].unsqueeze(2) pxy = (xy1 + xy2) * 0.5 pwh = xy2 - xy1