From a92d9c653ad6272a39b469160c04e982efffc0f2 Mon Sep 17 00:00:00 2001 From: ly015 Date: Wed, 2 Mar 2022 17:02:35 +0800 Subject: [PATCH 1/6] add windows-ci --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06e4463107..288842466c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -205,3 +205,49 @@ jobs: env_vars: OS,PYTHON name: codecov-umbrella fail_ci_if_error: false + + build_windows: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2022] + python-version: [3.8] + platform: [cpu, 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: Upgrade pip + run: pip install pip --upgrade --user + - name: Install PyTorch + # As a complement to Linux CI, we test on PyTorch LTS version + run: pip install torch==1.8.2+${{ matrix.platform }} torchvision==0.9.2+${{ matrix.platform }} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html + - name: Install MMCV + run: pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.8/index.html --only-binary mmcv-full + - name: Install mmpose dependencies + run: | + python -V + python -m pip install xtcocotools + python -m pip install -r requirements/tests.txt -r requirements/optional.txt + python -m pip install albumentations>=0.3.2 --no-binary imgaug,albumentations + python -c 'import mmcv; print(mmcv.__version__)' + - name: Show pip list + run: pip list + - name: Build and install + run: pip install -e . + - name: Run unittests + run: coverage run --branch --source mmdet -m pytest tests -sv + - name: Generate coverage report + run: | + 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 From c66057e10d3b43e79de6eb6c1e034a458748d505 Mon Sep 17 00:00:00 2001 From: ly015 Date: Wed, 2 Mar 2022 18:45:20 +0800 Subject: [PATCH 2/6] reduce input size to save memory --- tests/test_backbones/test_hourglass.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_backbones/test_hourglass.py b/tests/test_backbones/test_hourglass.py index 342ac1c66b..3a85610969 100644 --- a/tests/test_backbones/test_hourglass.py +++ b/tests/test_backbones/test_hourglass.py @@ -28,21 +28,21 @@ def test_hourglass_backbone(): model.init_weights() model.train() - imgs = torch.randn(1, 3, 511, 511) + imgs = torch.randn(1, 3, 256, 256) feat = model(imgs) assert len(feat) == 1 - assert feat[0].shape == torch.Size([1, 256, 128, 128]) + assert feat[0].shape == torch.Size([1, 256, 64, 64]) # Test HourglassNet-104 model = HourglassNet(num_stacks=2) model.init_weights() model.train() - imgs = torch.randn(1, 3, 511, 511) + imgs = torch.randn(1, 3, 256, 256) feat = model(imgs) assert len(feat) == 2 - assert feat[0].shape == torch.Size([1, 256, 128, 128]) - assert feat[1].shape == torch.Size([1, 256, 128, 128]) + assert feat[0].shape == torch.Size([1, 256, 64, 64]) + assert feat[1].shape == torch.Size([1, 256, 64, 64]) def test_hourglass_ae_backbone(): @@ -60,18 +60,18 @@ def test_hourglass_ae_backbone(): model.init_weights() model.train() - imgs = torch.randn(1, 3, 512, 512) + imgs = torch.randn(1, 3, 256, 256) feat = model(imgs) assert len(feat) == 1 - assert feat[0].shape == torch.Size([1, 34, 128, 128]) + assert feat[0].shape == torch.Size([1, 34, 64, 64]) # num_stack=2 model = HourglassAENet(num_stacks=2) model.init_weights() model.train() - imgs = torch.randn(1, 3, 512, 512) + imgs = torch.randn(1, 3, 256, 256) feat = model(imgs) assert len(feat) == 2 - assert feat[0].shape == torch.Size([1, 34, 128, 128]) - assert feat[1].shape == torch.Size([1, 34, 128, 128]) + assert feat[0].shape == torch.Size([1, 34, 64, 64]) + assert feat[1].shape == torch.Size([1, 34, 64, 64]) From 676a431997daac22713e3c254b194a98cfa01d36 Mon Sep 17 00:00:00 2001 From: ly015 Date: Thu, 3 Mar 2022 09:45:12 +0800 Subject: [PATCH 3/6] fix codecov --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 288842466c..8b9edc9a48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -238,7 +238,7 @@ jobs: - name: Build and install run: pip install -e . - name: Run unittests - run: coverage run --branch --source mmdet -m pytest tests -sv + run: coverage run --branch --source mmpose -m pytest tests -sv - name: Generate coverage report run: | coverage xml From 07f2600f7edf1ce9909f7d13d8e9eec7e0dda03a Mon Sep 17 00:00:00 2001 From: ly015 Date: Thu, 3 Mar 2022 12:09:34 +0800 Subject: [PATCH 4/6] reduce input size to save memory --- tests/test_models/test_voxelpose.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_models/test_voxelpose.py b/tests/test_models/test_voxelpose.py index a1310ef4e3..96844e2175 100644 --- a/tests/test_models/test_voxelpose.py +++ b/tests/test_models/test_voxelpose.py @@ -18,8 +18,8 @@ def test_voxelpose_forward(): space_center = [0, -500, 800] cube_size = [20, 20, 8] train_data_cfg = dict( - image_size=[960, 512], - heatmap_size=[[240, 128]], + image_size=[240, 128], + heatmap_size=[[60, 32]], space_size=space_size, space_center=space_center, cube_size=cube_size, @@ -58,7 +58,7 @@ def test_voxelpose_forward(): ] project_layer = ProjectLayer( - dict(image_size=[960, 512], heatmap_size=[240, 128])) + dict(image_size=[240, 128], heatmap_size=[60, 32])) root_net = CuboidProposalNet( dict(type='V2VNet', input_channels=15, output_channels=1)) center_head = builder.build_head( From 31b7580d3c6bce9761b70c2e6a34ef1752dc9a1d Mon Sep 17 00:00:00 2001 From: ly015 Date: Thu, 3 Mar 2022 19:20:07 +0800 Subject: [PATCH 5/6] skip voxelpose unittest for Windows --- configs/_base_/filters/gausian_filter.py | 0 tests/test_models/test_voxelpose.py | 12 +++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 configs/_base_/filters/gausian_filter.py diff --git a/configs/_base_/filters/gausian_filter.py b/configs/_base_/filters/gausian_filter.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/test_models/test_voxelpose.py b/tests/test_models/test_voxelpose.py index 96844e2175..c8fbb493c5 100644 --- a/tests/test_models/test_voxelpose.py +++ b/tests/test_models/test_voxelpose.py @@ -1,6 +1,8 @@ # Copyright (c) OpenMMLab. All rights reserved. +import platform import tempfile +import pytest from mmcv import Config from mmpose.datasets import DATASETS, build_dataloader @@ -9,6 +11,10 @@ PoseRegressionNet, ProjectLayer) +@pytest.mark.skipif( + platform.system() == 'Windows', + reason='Windows container on Github Action does not have enough RAM ' + 'to run the test.') def test_voxelpose_forward(): dataset = 'Body3DMviewDirectPanopticDataset' dataset_class = DATASETS.get(dataset) @@ -18,8 +24,8 @@ def test_voxelpose_forward(): space_center = [0, -500, 800] cube_size = [20, 20, 8] train_data_cfg = dict( - image_size=[240, 128], - heatmap_size=[[60, 32]], + image_size=[960, 512], + heatmap_size=[[240, 128]], space_size=space_size, space_center=space_center, cube_size=cube_size, @@ -58,7 +64,7 @@ def test_voxelpose_forward(): ] project_layer = ProjectLayer( - dict(image_size=[240, 128], heatmap_size=[60, 32])) + dict(image_size=[960, 512], heatmap_size=[240, 128])) root_net = CuboidProposalNet( dict(type='V2VNet', input_channels=15, output_channels=1)) center_head = builder.build_head( From 88c9a5378ac3a6edc54556738ebe2dcda101e8e6 Mon Sep 17 00:00:00 2001 From: ly015 Date: Fri, 4 Mar 2022 15:45:37 +0800 Subject: [PATCH 6/6] remove win+cuda test --- .github/workflows/build.yml | 2 +- tests/test_models/test_voxelpose.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b9edc9a48..90f58b86e0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -212,7 +212,7 @@ jobs: matrix: os: [windows-2022] python-version: [3.8] - platform: [cpu, cu111] + platform: [cpu] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/tests/test_models/test_voxelpose.py b/tests/test_models/test_voxelpose.py index c8fbb493c5..a1310ef4e3 100644 --- a/tests/test_models/test_voxelpose.py +++ b/tests/test_models/test_voxelpose.py @@ -1,8 +1,6 @@ # Copyright (c) OpenMMLab. All rights reserved. -import platform import tempfile -import pytest from mmcv import Config from mmpose.datasets import DATASETS, build_dataloader @@ -11,10 +9,6 @@ PoseRegressionNet, ProjectLayer) -@pytest.mark.skipif( - platform.system() == 'Windows', - reason='Windows container on Github Action does not have enough RAM ' - 'to run the test.') def test_voxelpose_forward(): dataset = 'Body3DMviewDirectPanopticDataset' dataset_class = DATASETS.get(dataset)