Skip to content

Commit 2a642ed

Browse files
committed
support Oriented CastDet
0 parents  commit 2a642ed

674 files changed

Lines changed: 175935 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: 2.1
2+
3+
# this allows you to use CircleCI's dynamic configuration feature
4+
setup: true
5+
6+
# the path-filtering orb is required to continue a pipeline based on
7+
# the path of an updated fileset
8+
orbs:
9+
path-filtering: circleci/path-filtering@0.1.2
10+
11+
workflows:
12+
# the always-run workflow is always triggered, regardless of the pipeline parameters.
13+
always-run:
14+
jobs:
15+
# the path-filtering/filter job determines which pipeline
16+
# parameters to update.
17+
- path-filtering/filter:
18+
name: check-updated-files
19+
# 3-column, whitespace-delimited mapping. One mapping per
20+
# line:
21+
# <regex path-to-test> <parameter-to-set> <value-of-pipeline-parameter>
22+
mapping: |
23+
mmrotate/.* lint_only false
24+
requirements/.* lint_only false
25+
tests/.* lint_only false
26+
tools/.* lint_only false
27+
configs/.* lint_only false
28+
.circleci/.* lint_only false
29+
base-revision: dev-1.x
30+
# this is the path of the configuration we should trigger once
31+
# path filtering and pipeline parameter value updates are
32+
# complete. In this case, we are using the parent dynamic
33+
# configuration itself.
34+
config-path: .circleci/test.yml

.circleci/docker/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG PYTORCH="1.8.1"
2+
ARG CUDA="10.2"
3+
ARG CUDNN="7"
4+
5+
FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
6+
7+
# To fix GPG key error when running apt-get update
8+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
9+
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
10+
11+
RUN apt-get update && apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx

.circleci/scripts/get_mmcv_var.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
TORCH=$1
4+
CUDA=$2
5+
6+
# 10.2 -> cu102
7+
MMCV_CUDA="cu`echo ${CUDA} | tr -d '.'`"
8+
9+
# MMCV only provides pre-compiled packages for torch 1.x.0
10+
# which works for any subversions of torch 1.x.
11+
# We force the torch version to be 1.x.0 to ease package searching
12+
# and avoid unnecessary rebuild during MMCV's installation.
13+
TORCH_VER_ARR=(${TORCH//./ })
14+
TORCH_VER_ARR[2]=0
15+
printf -v MMCV_TORCH "%s." "${TORCH_VER_ARR[@]}"
16+
MMCV_TORCH=${MMCV_TORCH%?} # Remove the last dot
17+
18+
echo "export MMCV_CUDA=${MMCV_CUDA}" >> $BASH_ENV
19+
echo "export MMCV_TORCH=${MMCV_TORCH}" >> $BASH_ENV

.circleci/test.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
version: 2.1
2+
3+
orbs:
4+
codecov: codecov/codecov@3.2.2
5+
6+
# the default pipeline parameters, which will be updated according to
7+
# the results of the path-filtering orb
8+
parameters:
9+
lint_only:
10+
type: boolean
11+
default: true
12+
13+
jobs:
14+
lint:
15+
docker:
16+
- image: cimg/python:3.7.4
17+
steps:
18+
- checkout
19+
- run:
20+
name: Install pre-commit hook
21+
command: |
22+
pip install pre-commit
23+
pre-commit install
24+
- run:
25+
name: Linting
26+
command: pre-commit run --all-files
27+
- run:
28+
name: Check docstring coverage
29+
command: |
30+
pip install interrogate
31+
interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-magic --ignore-regex "__repr__" --fail-under 90 mmrotate
32+
build_cpu:
33+
parameters:
34+
# The python version must match available image tags in
35+
# https://circleci.com/developer/images/image/cimg/python
36+
python:
37+
type: string
38+
torch:
39+
type: string
40+
torchvision:
41+
type: string
42+
docker:
43+
- image: cimg/python:<< parameters.python >>
44+
resource_class: large
45+
steps:
46+
- checkout
47+
- run:
48+
name: Install Libraries
49+
command: |
50+
sudo apt-get update
51+
sudo apt-get install -y ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx libjpeg-dev zlib1g-dev libtinfo-dev libncurses5 libgeos-dev
52+
- run:
53+
name: Configure Python & pip
54+
command: |
55+
pip install --upgrade pip
56+
pip install wheel
57+
- run:
58+
name: Install PyTorch
59+
command: |
60+
python -V
61+
pip install torch==<< parameters.torch >>+cpu torchvision==<< parameters.torchvision >>+cpu -f https://download.pytorch.org/whl/torch_stable.html
62+
- run:
63+
name: Install mmrotate dependencies
64+
command: |
65+
pip install git+https://github.com/open-mmlab/mmengine.git@main
66+
pip install -U openmim
67+
mim install 'mmcv >= 2.0.0rc2'
68+
pip install git+https://github.com/open-mmlab/mmdetection.git@dev-3.x
69+
pip install -r requirements/tests.txt
70+
- run:
71+
name: Build and install
72+
command: |
73+
pip install -e .
74+
- run:
75+
name: Run unittests
76+
command: |
77+
pytest tests/
78+
build_cuda:
79+
parameters:
80+
torch:
81+
type: string
82+
cuda:
83+
type: enum
84+
enum: ["10.1", "10.2", "11.1"]
85+
cudnn:
86+
type: integer
87+
default: 7
88+
machine:
89+
image: ubuntu-2004-cuda-11.4:202110-01
90+
# docker_layer_caching: true
91+
resource_class: gpu.nvidia.small
92+
steps:
93+
- checkout
94+
- run:
95+
# Cloning repos in VM since Docker doesn't have access to the private key
96+
name: Clone Repos
97+
command: |
98+
git clone -b main --depth 1 https://github.com/open-mmlab/mmengine.git /home/circleci/mmengine
99+
git clone -b dev-3.x --depth 1 https://github.com/open-mmlab/mmdetection.git /home/circleci/mmdetection
100+
git clone --depth 1 https://github.com/QUVA-Lab/e2cnn.git /home/circleci/e2cnn
101+
- run:
102+
name: Build Docker image
103+
command: |
104+
docker build .circleci/docker -t mmrotate:gpu --build-arg PYTORCH=<< parameters.torch >> --build-arg CUDA=<< parameters.cuda >> --build-arg CUDNN=<< parameters.cudnn >>
105+
docker run --gpus all -t -d -v /home/circleci/project:/mmrotate -v /home/circleci/mmengine:/mmengine -v /home/circleci/mmdetection:/mmdetection -w /mmrotate --name mmrotate mmrotate:gpu
106+
docker exec mmrotate apt-get install -y git
107+
- run:
108+
name: Install mmrotate dependencies
109+
command: |
110+
docker exec mmrotate pip install -e /mmengine
111+
docker exec mmrotate pip install -U openmim
112+
docker exec mmrotate mim install 'mmcv >= 2.0.0rc2'
113+
docker exec mmrotate pip install -e /mmdetection
114+
docker exec mmrotate pip install -r requirements/tests.txt
115+
- run:
116+
name: Build and install
117+
command: |
118+
docker exec mmrotate pip install -e .
119+
- run:
120+
name: Run unittests
121+
command: |
122+
docker exec mmrotate coverage run --branch --source mmrotate -m pytest tests/
123+
docker exec mmrotate coverage xml
124+
docker exec mmrotate coverage report -m
125+
- codecov/upload
126+
workflows:
127+
pr_stage_lint:
128+
when: << pipeline.parameters.lint_only >>
129+
jobs:
130+
- lint:
131+
name: lint
132+
filters:
133+
branches:
134+
ignore:
135+
- dev-1.x
136+
- 1.x
137+
pr_stage_test:
138+
when:
139+
not:
140+
<< pipeline.parameters.lint_only >>
141+
jobs:
142+
- lint:
143+
name: lint
144+
filters:
145+
branches:
146+
ignore:
147+
- dev-1.x
148+
- test-1.x
149+
- build_cpu:
150+
name: minimum_version_cpu
151+
torch: 1.6.0
152+
torchvision: 0.7.0
153+
python: 3.7.4
154+
requires:
155+
- lint
156+
- build_cpu:
157+
name: maximum_version_cpu
158+
torch: 1.13.0
159+
torchvision: 0.14.0
160+
python: 3.9.0
161+
requires:
162+
- minimum_version_cpu
163+
- hold:
164+
type: approval
165+
requires:
166+
- maximum_version_cpu
167+
- build_cuda:
168+
name: mainstream_version_gpu
169+
torch: 1.8.1
170+
# Use double quotation mark to explicitly specify its type
171+
# as string instead of number
172+
cuda: "10.2"
173+
requires:
174+
- hold
175+
merge_stage_test:
176+
when:
177+
not:
178+
<< pipeline.parameters.lint_only >>
179+
jobs:
180+
- build_cuda:
181+
name: minimum_version_gpu
182+
torch: 1.6.0
183+
# Use double quotation mark to explicitly specify its type
184+
# as string instead of number
185+
cuda: "10.1"
186+
filters:
187+
branches:
188+
only:
189+
- dev-1.x

0 commit comments

Comments
 (0)