glenn-jocher
commited on
Commit
•
94705a9
1
Parent(s):
0c87478
Add Hub custom models to CI tests (#4978)
Browse files* Update ci-testing.yml for Hub custom model tests
* Update ci-testing.yml
- .github/workflows/ci-testing.yml +18 -12
.github/workflows/ci-testing.yml
CHANGED
@@ -4,10 +4,10 @@ name: CI CPU testing
|
|
4 |
|
5 |
on: # https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
6 |
push:
|
7 |
-
branches: [master]
|
8 |
pull_request:
|
9 |
# The branches below must be a subset of the branches above
|
10 |
-
branches: [master]
|
11 |
schedule:
|
12 |
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
|
13 |
|
@@ -18,9 +18,9 @@ jobs:
|
|
18 |
strategy:
|
19 |
fail-fast: false
|
20 |
matrix:
|
21 |
-
os: [ubuntu-latest, macos-latest, windows-latest]
|
22 |
-
python-version: [3.8]
|
23 |
-
model: ['yolov5s'] # models to test
|
24 |
|
25 |
# Timeout: https://stackoverflow.com/a/59076067/4521646
|
26 |
timeout-minutes: 50
|
@@ -65,19 +65,25 @@ jobs:
|
|
65 |
- name: Tests workflow
|
66 |
run: |
|
67 |
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
|
68 |
-
di=cpu
|
69 |
|
70 |
-
#
|
71 |
python train.py --img 128 --batch 16 --weights ${{ matrix.model }}.pt --cfg ${{ matrix.model }}.yaml --epochs 1 --device $di
|
72 |
-
#
|
73 |
-
python detect.py --weights ${{ matrix.model }}.pt --device $di
|
74 |
-
python detect.py --weights runs/train/exp/weights/last.pt --device $di
|
75 |
-
# val
|
76 |
python val.py --img 128 --batch 16 --weights ${{ matrix.model }}.pt --device $di
|
77 |
python val.py --img 128 --batch 16 --weights runs/train/exp/weights/last.pt --device $di
|
78 |
-
|
|
|
|
|
79 |
python hubconf.py # hub
|
|
|
80 |
python models/yolo.py --cfg ${{ matrix.model }}.yaml # build PyTorch model
|
81 |
python models/tf.py --weights ${{ matrix.model }}.pt # build TensorFlow model
|
82 |
python export.py --img 128 --batch 1 --weights ${{ matrix.model }}.pt --include torchscript onnx # export
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
shell: bash
|
|
|
4 |
|
5 |
on: # https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
6 |
push:
|
7 |
+
branches: [ master ]
|
8 |
pull_request:
|
9 |
# The branches below must be a subset of the branches above
|
10 |
+
branches: [ master ]
|
11 |
schedule:
|
12 |
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
|
13 |
|
|
|
18 |
strategy:
|
19 |
fail-fast: false
|
20 |
matrix:
|
21 |
+
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
22 |
+
python-version: [ 3.8 ]
|
23 |
+
model: [ 'yolov5s' ] # models to test
|
24 |
|
25 |
# Timeout: https://stackoverflow.com/a/59076067/4521646
|
26 |
timeout-minutes: 50
|
|
|
65 |
- name: Tests workflow
|
66 |
run: |
|
67 |
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
|
68 |
+
di=cpu # device
|
69 |
|
70 |
+
# Train
|
71 |
python train.py --img 128 --batch 16 --weights ${{ matrix.model }}.pt --cfg ${{ matrix.model }}.yaml --epochs 1 --device $di
|
72 |
+
# Val
|
|
|
|
|
|
|
73 |
python val.py --img 128 --batch 16 --weights ${{ matrix.model }}.pt --device $di
|
74 |
python val.py --img 128 --batch 16 --weights runs/train/exp/weights/last.pt --device $di
|
75 |
+
# Detect
|
76 |
+
python detect.py --weights ${{ matrix.model }}.pt --device $di
|
77 |
+
python detect.py --weights runs/train/exp/weights/last.pt --device $di
|
78 |
python hubconf.py # hub
|
79 |
+
# Export
|
80 |
python models/yolo.py --cfg ${{ matrix.model }}.yaml # build PyTorch model
|
81 |
python models/tf.py --weights ${{ matrix.model }}.pt # build TensorFlow model
|
82 |
python export.py --img 128 --batch 1 --weights ${{ matrix.model }}.pt --include torchscript onnx # export
|
83 |
+
# Python
|
84 |
+
python - <<EOF
|
85 |
+
import torch
|
86 |
+
model = torch.hub.load('ultralytics/yolov5', 'custom', path='runs/train/exp/weights/last.pt')
|
87 |
+
EOF
|
88 |
+
|
89 |
shell: bash
|