-
Notifications
You must be signed in to change notification settings - Fork 3.7k
85 lines (85 loc) · 3.3 KB
/
Copy pathtest.yml
File metadata and controls
85 lines (85 loc) · 3.3 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
---
name: Test
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
activate-environment: true
- shell: bash
run: |
make setup
- uses: awalsh128/cache-apt-pkgs-action@v1
if: matrix.os == 'ubuntu-latest'
with:
packages: xvfb libegl1 libxkbcommon0 libxcb-cursor0 libgl1
version: 1.0
- name: Test
shell: bash
if: matrix.os == 'ubuntu-latest'
env:
MPLBACKEND: agg
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:99
make test
- name: Run examples
shell: bash
if: matrix.os != 'windows-latest'
env:
MPLBACKEND: agg
run: |
labelme --help
labelme --version
# examples/ must stay self-contained: no labelme imports (#2231)
! grep -rnE "import labelme|from labelme" examples/
(cd examples/primitives && ../tutorial/export_json.py primitives.json && rm -rf primitives)
(cd examples/tutorial && rm -rf apc2016_obj3_json && ./export_json.py apc2016_obj3.json && python load_label_png.py && git checkout -- .)
(cd examples/semantic_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
(cd examples/instance_segmentation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
(cd examples/video_annotation && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
uv pip install lxml # for bbox_detection/labelme2voc.py
(cd examples/bbox_detection && rm -rf data_dataset_voc && ./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt && git checkout -- .)
uv pip install cython && uv pip install pycocotools # for instance_segmentation/labelme2coco.py
(cd examples/instance_segmentation && rm -rf data_dataset_coco && ./labelme2coco.py data_annotated data_dataset_coco --labels labels.txt && git checkout -- .)
- name: Build wheel and install from it
shell: bash
run: |-
uv build
uv pip install dist/labelme-*.whl
network-test:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
with:
python-version: '3.12'
activate-environment: true
- shell: bash
run: |
make setup
- uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: xvfb libegl1 libxkbcommon0 libxcb-cursor0 libgl1
version: 1.0
- name: Test real model download
shell: bash
env:
MPLBACKEND: agg
run: |-
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
export DISPLAY=:99
make test PYTEST_ARGS="-m network --numprocesses=1"