greenhouse/.github/workflows/ci-testing.yml
Glenn Jocher 76807fae71
YOLOv5 Forward Compatibility Update (#1569)
* YOLOv5 forward compatibility update

* add data dir

* ci test yolov3

* update build_targets()

* update build_targets()

* update build_targets()

* update yolov3-spp.yaml

* add yolov3-tiny.yaml

* add yolov3-tiny.yaml

* Update yolov3-tiny.yaml

* thop bug fix

* Detection() device bug fix

* Use torchvision.ops.nms()

* Remove redundant download mirror

* CI tests with yolov3-tiny

* Update README.md

* Synch train and test iou_thresh

* update requirements.txt

* Cat apriori autolabels

* Confusion matrix

* Autosplit

* Autosplit

* Update README.md

* AP no plot

* Update caching

* Update caching

* Caching bug fix

* --image-weights bug fix

* datasets bug fix

* mosaic plots bug fix

* plot_study

* boxes.max()

* boxes.max()

* boxes.max()

* boxes.max()

* boxes.max()

* boxes.max()

* update

* Update README

* Update README

* Update README.md

* Update README.md

* results png

* Update README

* Targets scaling bug fix

* update plot_study

* update plot_study

* update plot_study

* update plot_study

* Targets scaling bug fix

* Finish Readme.md

* Finish Readme.md

* Finish Readme.md

* Update README.md

* Creado con Colaboratory
2020-11-26 20:24:00 +01:00

77 lines
2.8 KiB
YAML

name: CI CPU testing
on: # https://help.github.com/en/actions/reference/events-that-trigger-workflows
push:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
cpu-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.8]
model: ['yolov3-tiny'] # models to test
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 50
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
- name: Get pip cache
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: Cache pip
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -qr requirements.txt -f https://download.pytorch.org/whl/cpu/torch_stable.html
pip install -q onnx
python --version
pip --version
pip list
shell: bash
- name: Download data
run: |
# curl -L -o tmp.zip https://github.com/ultralytics/yolov5/releases/download/v1.0/coco128.zip
# unzip -q tmp.zip -d ../
# rm tmp.zip
- name: Tests workflow
run: |
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
di=cpu # inference devices # define device
# train
python train.py --img 256 --batch 8 --weights weights/${{ matrix.model }}.pt --cfg models/${{ matrix.model }}.yaml --epochs 1 --device $di
# detect
python detect.py --weights weights/${{ matrix.model }}.pt --device $di
python detect.py --weights runs/train/exp/weights/last.pt --device $di
# test
python test.py --img 256 --batch 8 --weights weights/${{ matrix.model }}.pt --device $di
python test.py --img 256 --batch 8 --weights runs/train/exp/weights/last.pt --device $di
python models/yolo.py --cfg models/${{ matrix.model }}.yaml # inspect
python models/export.py --img 256 --batch 1 --weights weights/${{ matrix.model }}.pt # export
shell: bash