-
Notifications
You must be signed in to change notification settings - Fork 602
122 lines (100 loc) · 5.4 KB
/
package_testing.yml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Package Testing
on:
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Restore Ubuntu cache
uses: actions/cache@v3
if: matrix.operating-system == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-
- name: Restore MacOS cache
uses: actions/cache@v3
if: matrix.operating-system == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-
- name: Restore Windows cache
uses: actions/cache@v3
if: matrix.operating-system == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install PyTorch(1.10.2) and TorchVision(0.11.3) on Linux and Windows
if: >
matrix.operating-system == 'ubuntu-latest' ||
matrix.operating-system == 'windows-latest'
run: >
pip install torch==1.10.2+cpu torchvision==0.11.3+cpu
-f https://download.pytorch.org/whl/torch_stable.html
- name: Install PyTorch(1.10.1) and TorchVision(0.11.2) on MacOS
if: matrix.operating-system == 'macos-latest'
run: pip install torch==1.10.1 torchvision==0.11.2
- name: Install MMDetection(2.28.1) with MMCV(1.7.0)
run: >
pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.10.0/index.html
pip install mmdet==2.28.1
- name: Install YOLOv5(7.0.9)
run: >
pip install yolov5==7.0.9
- name: Install DeepSparse
run: >
pip install deepsparse
- name: Install Detectron2(0.6)
run: >
python -m pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/index.html
- name: Install Transformers(4.25.1)
run: >
pip install transformers==4.25.1
- name: Install pycocotools(2.0.6)
run: >
pip install pycocotools==2.0.6
- name: Install ultralytics
run: >
pip install ultralytics==8.0.99
- name: Install super-gradients
run: >
pip install super-gradients==3.1.2
- name: Install latest SAHI package
run: >
pip install --upgrade --force-reinstall sahi
- name: Unittest for SAHI+YOLOV5/MMDET/Detectron2 on all platforms
run: |
python -m unittest
- name: Test SAHI CLI
run: |
# predict mmdet
sahi predict --source tests/data/ --novisual --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_retinanet/retinanet_r50_fpn_1x_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/terrain1.jpg --export_pickle --export_crop --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/ --novisual --dataset_json_path tests/data/coco_utils/combined_coco.json --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco.py --image_size 320
# predict yolov5
sahi predict --no_sliced_prediction --model_type yolov5 --source tests/data/coco_utils/terrain1.jpg --novisual --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
sahi predict --model_type yolov5 --source tests/data/ --novisual --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
sahi predict --model_type yolov5 --source tests/data/coco_utils/terrain1.jpg --export_pickle --export_crop --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
sahi predict --model_type yolov5 --source tests/data/coco_utils/ --novisual --dataset_json_path tests/data/coco_utils/combined_coco.json --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
# coco yolov5
sahi coco yolov5 --image_dir tests/data/coco_utils/ --dataset_json_path tests/data/coco_utils/combined_coco.json --train_split 0.9
# coco evaluate
sahi coco evaluate --dataset_json_path tests/data/coco_evaluate/dataset.json --result_json_path tests/data/coco_evaluate/result.json
# coco analyse
sahi coco analyse --dataset_json_path tests/data/coco_evaluate/dataset.json --result_json_path tests/data/coco_evaluate/result.json --out_dir tests/data/coco_evaluate/