* Update * Logger step fix: Increment step with epochs (#8654) * enhance * revert * allow training from scratch * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update --img argument from train.py single line * fix image size from 640 to 128 * suport custom dataloader and augmentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * format * Update dataloaders.py * Single line return, single line comment, remove unused argument * address PR comments * fix spelling * don't augment eval set * use fstring * update augmentations.py * new maning convention for transforms * reverse if statement, inline ops * reverse if statement, inline ops * updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update dataloaders * Remove additional if statement * Remove is_train as redundant * Cleanup * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleanup2 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update classifier.py * Update augmentations.py * fix: imshow clip warning * update * Revert ToTensorV2 removal * Update classifier.py * Update normalize values, revert uint8 * normalize image using cv2 * remove dedundant comment * Update classifier.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * replace print with logger * commit steps * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Allow logging models from GenericLogger (#8676) * enhance * revert * allow training from scratch * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update --img argument from train.py single line * fix image size from 640 to 128 * suport custom dataloader and augmentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * format * Update dataloaders.py * Single line return, single line comment, remove unused argument * address PR comments * fix spelling * don't augment eval set * use fstring * update augmentations.py * new maning convention for transforms * reverse if statement, inline ops * reverse if statement, inline ops * updates * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update dataloaders * Remove additional if statement * Remove is_train as redundant * Cleanup * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleanup2 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update classifier.py * Update augmentations.py * fix: imshow clip warning * update * Revert ToTensorV2 removal * Update classifier.py * Update normalize values, revert uint8 * normalize image using cv2 * remove dedundant comment * Update classifier.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * replace print with logger * commit steps * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * support final model logging * update * update * update * update * remove curses * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update classifier.py * Update __init__.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> * Update * Update * Update * Update * Update dataset download * Update dataset download * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Pass imgsz to classify_transforms() * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Update * Cos scheduler * Cos scheduler * Remove unused args * Update * Add seed * Add seed * Update * Update * Add run(), main() * Merge master * Merge master * Update * Update * Update * Update * Update * Update * Update * Create YOLOv5 BaseModel class (#8829) * Create BaseModel * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix * Hub load device fix * Update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Add experiment * Merge master * Attach names * weight decay = 1e-4 * weight decay = 5e-5 * update smart_optimizer console printout * fashion-mnist fix * Merge master * Update Table * Update Table * Remove destroy process group * add kwargs to forward() * fuse fix for resnet50 * nc, names fix for resnet50 * nc, names fix for resnet50 * ONNX CPU inference fix * revert * cuda * if augment or visualize * if augment or visualize * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * New smart_inference_mode() * Update README * Refactor into /classify dir * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * reset defaults * reset defaults * fix gpu predict * warmup * ema half fix * spacing * remove data * remove cache * remove denormalize * save run settings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * verbose false on initial plots * new save_yaml() function * Update ci-testing.yml * Path(data) CI fix * Separate classification CI * fix val * fix val * fix val * smartCrossEntropyLoss * skip validation on hub load * autodownload with working dir root * str(data) * Dataset usage example * im_show normalize * im_show normalize * add imagenet simple names to multibackend * Add validation speeds * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * 24-space names * Update bash scripts * Update permissions * Add bash script arguments * remove verbose * TRT data fix * names generator fix * optimize if names * update usage * Add local loading * Verbose=False * update names printing * Add Usage examples * Add Usage examples * Add Usage examples * Add Usage examples * named_children * reshape_classifier_outputs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * fix CI * fix incorrect class substitution * fix incorrect class substitution * remove denormalize * ravel fix * cleanup * update opt file printing * update opt file printing * update defaults * add opt to checkpoint * Add warning * Add comment * plot half bug fix * Use NotImplementedError * fix export shape report * Fix TRT load * cleanup CI * profile comment * CI fix * Add cls models * avoid inplace error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix usage examples * Update README * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README * Update README Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
136 lines
5.5 KiB
YAML
136 lines
5.5 KiB
YAML
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license
|
|
# YOLOv5 Continuous Integration (CI) GitHub Actions tests
|
|
|
|
name: YOLOv5 CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
schedule:
|
|
- cron: '0 0 * * *' # runs at 00:00 UTC every day
|
|
|
|
jobs:
|
|
Benchmarks:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ ubuntu-latest ]
|
|
python-version: [ '3.9' ] # requires python<=3.9
|
|
model: [ yolov5n ]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
#- name: Cache pip
|
|
# uses: actions/cache@v3
|
|
# with:
|
|
# path: ~/.cache/pip
|
|
# key: ${{ runner.os }}-Benchmarks-${{ hashFiles('requirements.txt') }}
|
|
# restore-keys: ${{ runner.os }}-Benchmarks-
|
|
- name: Install requirements
|
|
run: |
|
|
python -m pip install --upgrade pip wheel
|
|
pip install -r requirements.txt coremltools openvino-dev tensorflow-cpu --extra-index-url https://download.pytorch.org/whl/cpu
|
|
python --version
|
|
pip --version
|
|
pip list
|
|
- name: Run benchmarks
|
|
run: |
|
|
python utils/benchmarks.py --weights ${{ matrix.model }}.pt --img 320 --hard-fail
|
|
|
|
Tests:
|
|
timeout-minutes: 60
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
|
python-version: [ '3.10' ]
|
|
model: [ yolov5n ]
|
|
include:
|
|
- os: ubuntu-latest
|
|
python-version: '3.7' # '3.6.8' min
|
|
model: yolov5n
|
|
- os: ubuntu-latest
|
|
python-version: '3.8'
|
|
model: yolov5n
|
|
- os: ubuntu-latest
|
|
python-version: '3.9'
|
|
model: yolov5n
|
|
- os: ubuntu-latest
|
|
python-version: '3.8' # torch 1.7.0 requires python >=3.6, <=3.8
|
|
model: yolov5n
|
|
torch: '1.7.0' # min torch version CI https://pypi.org/project/torchvision/
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Get cache dir
|
|
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
- name: Cache pip
|
|
uses: actions/cache@v3
|
|
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 requirements
|
|
run: |
|
|
python -m pip install --upgrade pip wheel
|
|
if [ "${{ matrix.torch }}" == "1.7.0" ]; then
|
|
pip install -r requirements.txt torch==1.7.0 torchvision==0.8.1 --extra-index-url https://download.pytorch.org/whl/cpu
|
|
else
|
|
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
|
|
fi
|
|
shell: bash # for Windows compatibility
|
|
- name: Check environment
|
|
run: |
|
|
python -c "import utils; utils.notebook_init()"
|
|
echo "RUNNER_OS is ${{ runner.os }}"
|
|
echo "GITHUB_EVENT_NAME is ${{ github.event_name }}"
|
|
echo "GITHUB_WORKFLOW is ${{ github.workflow }}"
|
|
echo "GITHUB_ACTOR is ${{ github.actor }}"
|
|
echo "GITHUB_REPOSITORY is ${{ github.repository }}"
|
|
echo "GITHUB_REPOSITORY_OWNER is ${{ github.repository_owner }}"
|
|
python --version
|
|
pip --version
|
|
pip list
|
|
- name: Test detection
|
|
shell: bash # for Windows compatibility
|
|
run: |
|
|
# export PYTHONPATH="$PWD" # to run '$ python *.py' files in subdirectories
|
|
m=${{ matrix.model }} # official weights
|
|
b=runs/train/exp/weights/best # best.pt checkpoint
|
|
python train.py --imgsz 64 --batch 32 --weights $m.pt --cfg $m.yaml --epochs 1 --device cpu # train
|
|
for d in cpu; do # devices
|
|
for w in $m $b; do # weights
|
|
python val.py --imgsz 64 --batch 32 --weights $w.pt --device $d # val
|
|
python detect.py --imgsz 64 --weights $w.pt --device $d # detect
|
|
done
|
|
done
|
|
python hubconf.py --model $m # hub
|
|
# python models/tf.py --weights $m.pt # build TF model
|
|
python models/yolo.py --cfg $m.yaml # build PyTorch model
|
|
python export.py --weights $m.pt --img 64 --include torchscript # export
|
|
python - <<EOF
|
|
import torch
|
|
for path in '$m', '$b':
|
|
model = torch.hub.load('.', 'custom', path=path, source='local')
|
|
print(model('data/images/bus.jpg'))
|
|
EOF
|
|
- name: Test classification
|
|
shell: bash # for Windows compatibility
|
|
run: |
|
|
m=${{ matrix.model }}-cls.pt # official weights
|
|
b=runs/train-cls/exp/weights/best.pt # best.pt checkpoint
|
|
python classify/train.py --imgsz 32 --model $m --data mnist2560 --epochs 1 # train
|
|
python classify/val.py --imgsz 32 --weights $b --data ../datasets/mnist2560 # val
|
|
python classify/predict.py --imgsz 32 --weights $b --source ../datasets/mnist2560/test/7/60.png # predict
|
|
python classify/predict.py --imgsz 32 --weights $m --source data/images/bus.jpg # predict
|
|
python export.py --weights $b --img 64 --imgsz 224 --include torchscript # export
|