Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add Windows CI #1213

Merged
merged 6 commits into from
Mar 4, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 mmpose -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
20 changes: 10 additions & 10 deletions tests/test_backbones/test_hourglass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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])