-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathci-pytorch-object-detectors.yml
More file actions
105 lines (88 loc) · 3.53 KB
/
ci-pytorch-object-detectors.yml
File metadata and controls
105 lines (88 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: CI PyTorchObjectDetectors
on:
# Run on manual trigger
workflow_dispatch:
# Run on pull requests
pull_request:
paths-ignore:
- '*.md'
# Run on merge queue
merge_group:
# Run when pushing to main or dev branches
push:
branches:
- main
- dev*
# Run scheduled CI flow daily
schedule:
- cron: '0 8 * * 0'
jobs:
test_pytorch_fasterrcnn:
name: PyTorchObjectDetectors
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: Checkout Repo
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Free up space
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android
sudo apt-get clean
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get -y -q install ffmpeg libavcodec-extra
pip install -q -r requirements_test.txt
pip list
- name: Cache CIFAR-10 dataset
uses: actions/cache@v4
with:
path: ~/.art/data/cifar-10-batches-py
key: cifar10-dataset-cache-v1
- name: Cache MNIST dataset
uses: actions/cache@v4
with:
path: ~/.art/data/mnist.npz
key: mnist-dataset-cache-v1
- name: Download and extract CIFAR-10 if not cached
run: |
mkdir -p ~/.art/data
if [ ! -d ~/.art/data/cifar-10-batches-py ]; then
echo "Downloading CIFAR-10 dataset..."
if curl -L -f -o cifar-10-python.tar.gz https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz; then
echo "Downloaded from www.cs.toronto.edu"
else
echo "Primary download failed, trying Dropbox mirror..."
curl -L -o cifar-10-python.tar.gz "https://www.dropbox.com/scl/fi/6mhiq4rtfszqrosasp8a9/cifar-10-batches-py.tar.gz?rlkey=g6v114un4je233j52tu5tdsbe&st=gxo2e50q&dl=1"
fi
tar -xzf cifar-10-python.tar.gz -C ~/.art/data/
else
echo "CIFAR-10 already cached."
fi
- name: Download MNIST if not cached
run: |
mkdir -p ~/.art/data
if [ ! -f ~/.art/data/mnist.npz ]; then
echo "Downloading MNIST dataset..."
curl -L -o ~/.art/data/mnist.npz https://s3.amazonaws.com/img-datasets/mnist.npz
else
echo "MNIST already cached."
fi
- name: Run Test Action - test_pytorch_object_detector
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_pytorch_object_detector.py --framework=pytorch --durations=0
- name: Run Test Action - test_pytorch_faster_rcnn
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_pytorch_faster_rcnn.py --framework=pytorch --durations=0
- name: Run Test Action - test_pytorch_detection_transformer
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_pytorch_detection_transformer.py --framework=pytorch --durations=0
- name: Run Test Action - test_pytorch_object_seeker_faster_rcnn
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/object_detection/test_object_seeker_faster_rcnn.py --framework=pytorch --durations=0
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true