COCO8 and COCO8-seg Pytest and CI updates (#307)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: RangiLyu <lyuchqi@gmail.com>
This commit is contained in:
Glenn Jocher
2023-01-13 14:34:51 +01:00
committed by GitHub
parent 2bc36d97ce
commit 70427579b8
13 changed files with 254 additions and 59 deletions

View File

@ -8,8 +8,8 @@ on:
branches: [main]
pull_request:
branches: [main]
# schedule:
# - cron: '0 0 * * *' # runs at 00:00 UTC every day
schedule:
- cron: '0 0 * * *' # runs at 00:00 UTC every day
jobs:
Tests:
@ -54,7 +54,7 @@ jobs:
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
fi
# pip install ultralytics (production)
pip install .
pip install -e . pytest
shell: bash # for Windows compatibility
- name: Check environment
run: |
@ -78,21 +78,21 @@ jobs:
from ultralytics import hub, yolo
key = os.environ['APIKEY']
print(ultralytics.__version__)
# ultralytics.checks()
ultralytics.checks()
# ultralytics.reset_model(key) # reset trained model
# ultralytics.start(key) # train model
- name: Test detection
shell: bash # for Windows compatibility
run: |
yolo task=detect mode=train model=yolov8n.yaml data=coco128.yaml epochs=1 imgsz=32
yolo task=detect mode=train model=yolov8n.yaml data=coco8.yaml epochs=1 imgsz=32
yolo task=detect mode=val model=runs/detect/train/weights/last.pt imgsz=32
yolo task=detect mode=predict model=runs/detect/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
yolo mode=export model=runs/detect/train/weights/last.pt imgsz=32 format=torchscript
- name: Test segmentation
shell: bash # for Windows compatibility
run: |
yolo task=segment mode=train model=yolov8n-seg.yaml data=coco128-seg.yaml epochs=1 imgsz=32
yolo task=segment mode=val model=runs/segment/train/weights/last.pt data=coco128-seg.yaml imgsz=32
yolo task=segment mode=train model=yolov8n-seg.yaml data=coco8-seg.yaml epochs=1 imgsz=32
yolo task=segment mode=val model=runs/segment/train/weights/last.pt data=coco8-seg.yaml imgsz=32
yolo task=segment mode=predict model=runs/segment/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
yolo mode=export model=runs/segment/train/weights/last.pt imgsz=32 format=torchscript
- name: Test classification
@ -102,3 +102,6 @@ jobs:
yolo task=classify mode=val model=runs/classify/train/weights/last.pt data=mnist160 imgsz=32
yolo task=classify mode=predict model=runs/classify/train/weights/last.pt imgsz=32 source=ultralytics/assets/bus.jpg
yolo mode=export model=runs/classify/train/weights/last.pt imgsz=32 format=torchscript
- name: Pytest tests
shell: bash # for Windows compatibility
run: pytest tests