Skip to content

Merge branch 'main' into main #21

Merge branch 'main' into main

Merge branch 'main' into main #21

Workflow file for this run

name: CI
on: [ push, pull_request ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python: [ "3.9", "3.10", "3.11" ]
torch: [ "1.13.1", "2.0.1", "2.1.1" ]
include:
- torch: "1.13.1"
torchvision: "0.14.1"
- torch: "2.0.1"
torchvision: "0.15.2"
- torch: "2.1.1"
torchvision: "0.16.1"
exclude:
- python: "3.11"
torch: "1.13.1"
env:
# point datasets to ~/.torch so it's cached by CI
DETECTRON2_DATASETS: ~/.torch/datasets
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
${{ env.pythonLocation }}/lib/python${{ matrix.python }}/site-packages
~/.torch
key: ${{ runner.os }}-torch${{ matrix.torch }}-${{ hashFiles('setup.py') }}-20231129
- name: Install dependencies macOS
if: matrix.os == 'macos-latest'
run: |
python -m pip install -U pip
python -m pip install ninja opencv-python-headless onnx pytest-xdist
python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
# install from github to get latest; install iopath first since fvcore depends on it
python -m pip install -U 'git+https://github.com/facebookresearch/iopath'
python -m pip install -U 'git+https://github.com/facebookresearch/fvcore'
- name: Install dependencies ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
python -m pip install -U pip
python -m pip install ninja opencv-python-headless onnx pytest-xdist
python -m pip install torch==${{matrix.torch}}+cpu torchvision==${{matrix.torchvision}}+cpu --index-url https://download.pytorch.org/whl/cpu
# install from github to get latest; install iopath first since fvcore depends on it
python -m pip install -U 'git+https://github.com/facebookresearch/iopath'
python -m pip install -U 'git+https://github.com/facebookresearch/fvcore'
- name: Build and install macos
if: matrix.os == 'macOS'
run: |
CC=clang CXX=clang++ python -m pip install -e .[all]
python -m detectron2.utils.collect_env
- name: Create wheel
run: |
python -m pip install wheel
python setup.py bdist_wheel
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: detectron2-${{ matrix.python }}-pytorch${{ matrix.torch }}-${{matrix.os}}-wheel
path: dist/*.whl
- name: Build and install linux
if: matrix.os == 'ubuntu-latest'
run: |
python -m pip install -e .[all]
python -m detectron2.utils.collect_env
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
name: detectron2-${{ matrix.python }}-pytorch${{ matrix.torch }}-${{matrix.os}}-wheel
path: dist/*.whl