Skip to content

Commit de49566

Browse files
authored
fix: 🐞 enable push triggers for MMDet CI and update find-links in pyproject.toml (#1292)
Signed-off-by: Onuralp SEZER <[email protected]>
1 parent 04410e5 commit de49566

File tree

2 files changed

+110
-110
lines changed

2 files changed

+110
-110
lines changed

.github/workflows/mmdet.yml

Lines changed: 107 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,120 @@
1-
name: MMDet CI
2-
on:
3-
workflow_dispatch:
1+
# name: MMDet CI
2+
# on:
3+
# workflow_dispatch:
44

5-
# push:
6-
# branches: [main]
7-
# paths:
8-
# # Core MMDet implementation files
9-
# - "sahi/models/mmdet.py"
10-
# - "sahi/utils/mmdet.py"
5+
# push:
6+
# branches: [main]
7+
# paths:
8+
# # Core MMDet implementation files
9+
# - "sahi/models/mmdet.py"
10+
# - "sahi/utils/mmdet.py"
1111

12-
# # Test files that run MMDet tests
13-
# - "tests/test_mmdetectionmodel.py"
14-
# - "tests/test_predict.py"
12+
# # Test files that run MMDet tests
13+
# - "tests/test_mmdetectionmodel.py"
14+
# - "tests/test_predict.py"
1515

16-
# # Files that integrate/register MMDet
17-
# - "sahi/auto_model.py"
18-
# - "sahi/models/__init__.py"
19-
# - "sahi/utils/import_utils.py"
16+
# # Files that integrate/register MMDet
17+
# - "sahi/auto_model.py"
18+
# - "sahi/models/__init__.py"
19+
# - "sahi/utils/import_utils.py"
2020

21-
# # Base classes that MMDet depends on
22-
# - "sahi/models/base.py"
23-
# - "sahi/predict.py"
24-
# - "sahi/postprocess/**"
21+
# # Base classes that MMDet depends on
22+
# - "sahi/models/base.py"
23+
# - "sahi/predict.py"
24+
# - "sahi/postprocess/**"
2525

26-
# # Workflow and dependency files
27-
# - ".github/workflows/mmdet.yml"
28-
# - "pyproject.toml"
26+
# # Workflow and dependency files
27+
# - ".github/workflows/mmdet.yml"
28+
# - "pyproject.toml"
2929

30-
# # Test data/configs used by MMDet tests
31-
# - "tests/data/models/mmdet/**"
32-
# - "tests/data/models/mmdet_*/**"
30+
# # Test data/configs used by MMDet tests
31+
# - "tests/data/models/mmdet/**"
32+
# - "tests/data/models/mmdet_*/**"
3333

34-
# pull_request:
35-
# branches: [main]
36-
# paths:
37-
# # Core MMDet implementation files
38-
# - "sahi/models/mmdet.py"
39-
# - "sahi/utils/mmdet.py"
34+
# pull_request:
35+
# branches: [main]
36+
# paths:
37+
# # Core MMDet implementation files
38+
# - "sahi/models/mmdet.py"
39+
# - "sahi/utils/mmdet.py"
4040

41-
# # Test files that run MMDet tests
42-
# - "tests/test_mmdetectionmodel.py"
43-
# - "tests/test_predict.py"
41+
# # Test files that run MMDet tests
42+
# - "tests/test_mmdetectionmodel.py"
43+
# - "tests/test_predict.py"
4444

45-
# # Files that integrate/register MMDet
46-
# - "sahi/auto_model.py"
47-
# - "sahi/models/__init__.py"
48-
# - "sahi/utils/import_utils.py"
45+
# # Files that integrate/register MMDet
46+
# - "sahi/auto_model.py"
47+
# - "sahi/models/__init__.py"
48+
# - "sahi/utils/import_utils.py"
4949

50-
# # Base classes that MMDet depends on
51-
# - "sahi/models/base.py"
52-
# - "sahi/predict.py"
53-
# - "sahi/postprocess/**"
50+
# # Base classes that MMDet depends on
51+
# - "sahi/models/base.py"
52+
# - "sahi/predict.py"
53+
# - "sahi/postprocess/**"
5454

55-
# # Workflow and dependency files
56-
# - ".github/workflows/mmdet.yml"
57-
# - "pyproject.toml"
55+
# # Workflow and dependency files
56+
# - ".github/workflows/mmdet.yml"
57+
# - "pyproject.toml"
5858

59-
# # Test data/configs used by MMDet tests
60-
# - "tests/data/models/mmdet/**"
61-
# - "tests/data/models/mmdet_*/**"
59+
# # Test data/configs used by MMDet tests
60+
# - "tests/data/models/mmdet/**"
61+
# - "tests/data/models/mmdet_*/**"
6262

63-
jobs:
64-
mmdet-tests:
65-
runs-on: ubuntu-latest
66-
strategy:
67-
matrix:
68-
python-version: ["3.11"] # Only test on Python 3.11
69-
steps:
70-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
71-
- name: Setup uv python package manager
72-
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
73-
with:
74-
python-version: ${{ matrix.python-version }}
75-
enable-cache: true
76-
prune-cache: false
77-
cache-dependency-glob: |
78-
**/pyproject.toml
79-
- name: Cache model weights
80-
uses: actions/cache@v4
81-
with:
82-
path: tests/data/models
83-
key: ${{ runner.os }}-models-${{ hashFiles('sahi/utils/mmdet.py') }}
84-
restore-keys: |
85-
${{ runner.os }}-models-
86-
- name: Install libgl
87-
run: sudo apt-get update && sudo apt-get install -y libgl1
88-
- name: Install dependencies
89-
run: |
90-
set -e
91-
# Create virtual environment with Python 3.11
92-
uv venv --python 3.11
93-
# Activate virtual environment
94-
source .venv/bin/activate
95-
# Install dev and mmdet dependencies
96-
uv sync --group dev --extra mmdet
97-
# Install specific torch version for MMDet compatibility AFTER uv sync
98-
uv pip install torch==2.1.2+cpu torchvision==0.16.2+cpu --index-url https://download.pytorch.org/whl/cpu
99-
- name: Verify .venv Activation
100-
run: |
101-
if [ ! -d ".venv" ]; then
102-
echo ".venv directory not found"
103-
exit 1
104-
fi
105-
source .venv/bin/activate
106-
- name: Run MMDet tests
107-
run: |
108-
source .venv/bin/activate
109-
pytest tests/test_mmdetection_model.py -n auto
110-
# Run MMDet-related tests from test_predict.py
111-
pytest tests/test_predict.py::test_get_prediction_mmdet -n auto
112-
pytest tests/test_predict.py::test_get_sliced_prediction_mmdet -n auto
113-
pytest tests/test_predict.py::test_mmdet_yolox_tiny_prediction -n auto
114-
- name: Test SAHI CLI with MMDet
115-
run: |
116-
source .venv/bin/activate
117-
set -e
118-
sahi predict --model_type mmdet --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/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
119-
sahi predict --model_type mmdet --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_8xb8-300e_coco.py --image_size 320
120-
sahi predict --model_type mmdet --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_8xb8-300e_coco.py --image_size 320
63+
# jobs:
64+
# mmdet-tests:
65+
# runs-on: ubuntu-latest
66+
# strategy:
67+
# matrix:
68+
# python-version: ["3.11"] # Only test on Python 3.11
69+
# steps:
70+
# - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
71+
# - name: Setup uv python package manager
72+
# uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
73+
# with:
74+
# python-version: ${{ matrix.python-version }}
75+
# enable-cache: true
76+
# prune-cache: false
77+
# cache-dependency-glob: |
78+
# **/pyproject.toml
79+
# - name: Cache model weights
80+
# uses: actions/cache@v4
81+
# with:
82+
# path: tests/data/models
83+
# key: ${{ runner.os }}-models-${{ hashFiles('sahi/utils/mmdet.py') }}
84+
# restore-keys: |
85+
# ${{ runner.os }}-models-
86+
# - name: Install libgl
87+
# run: sudo apt-get update && sudo apt-get install -y libgl1
88+
# - name: Install dependencies
89+
# run: |
90+
# set -e
91+
# # Create virtual environment with Python 3.11
92+
# uv venv --python 3.11
93+
# # Activate virtual environment
94+
# source .venv/bin/activate
95+
# # Install dev and mmdet dependencies
96+
# uv sync --group dev --extra mmdet
97+
# # Install specific torch version for MMDet compatibility AFTER uv sync
98+
# uv pip install torch==2.1.2+cpu torchvision==0.16.2+cpu --index-url https://download.pytorch.org/whl/cpu
99+
# - name: Verify .venv Activation
100+
# run: |
101+
# if [ ! -d ".venv" ]; then
102+
# echo ".venv directory not found"
103+
# exit 1
104+
# fi
105+
# source .venv/bin/activate
106+
# - name: Run MMDet tests
107+
# run: |
108+
# source .venv/bin/activate
109+
# pytest tests/test_mmdetection_model.py -n auto
110+
# # Run MMDet-related tests from test_predict.py
111+
# pytest tests/test_predict.py::test_get_prediction_mmdet -n auto
112+
# pytest tests/test_predict.py::test_get_sliced_prediction_mmdet -n auto
113+
# pytest tests/test_predict.py::test_mmdet_yolox_tiny_prediction -n auto
114+
# - name: Test SAHI CLI with MMDet
115+
# run: |
116+
# source .venv/bin/activate
117+
# set -e
118+
# sahi predict --model_type mmdet --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/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
119+
# sahi predict --model_type mmdet --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_8xb8-300e_coco.py --image_size 320
120+
# sahi predict --model_type mmdet --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_8xb8-300e_coco.py --image_size 320

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ ci = [
124124

125125
[tool.uv]
126126

127-
# find-links = [
128-
# "http://download.openmmlab.com/mmcv/dist/cpu/torch2.1.0/index.html",
129-
# ]
127+
find-links = [
128+
"http://download.openmmlab.com/mmcv/dist/cpu/torch2.1.0/index.html",
129+
]
130130

131131
override-dependencies = ["pillow>=8.2.0"]
132132

0 commit comments

Comments
 (0)