Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ultralytics 8.2.1 adopt v8.2 GitHub assets URL (#10131) #3

Merged
merged 14 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ on:
description: "Run GPU"
default: false
type: boolean
raspberrypi:
description: "Run Raspberry Pi"
default: false
type: boolean
conda:
description: "Run Conda"
default: false
Expand Down Expand Up @@ -126,7 +130,7 @@ jobs:
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/yolov8s-worldv2.pt' imgsz=160 verbose=0.318
- name: Benchmark SegmentationModel
shell: bash
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-seg.pt' imgsz=160 verbose=0.280
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-seg.pt' imgsz=160 verbose=0.279
- name: Benchmark PoseModel
shell: bash
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-pose.pt' imgsz=160 verbose=0.183
Expand Down Expand Up @@ -221,6 +225,30 @@ jobs:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

RaspberryPi:
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event.inputs.raspberrypi == 'true')
timeout-minutes: 60
runs-on: raspberry-pi
steps:
- uses: actions/checkout@v4
- name: Activate Virtual Environment
run: |
python3.11 -m venv env
source env/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install requirements
run: |
python -m pip install --upgrade pip wheel
pip install -e . pytest mlflow pycocotools "ray[tune]<=2.9.3" --extra-index-url https://download.pytorch.org/whl/cpu
- name: Check environment
run: |
yolo checks
pip list
- name: Pytest tests
run: |
# pytest --slow tests/ # WARNING: Slow tests fail on Explorer Tests https://github.com/ultralytics/ultralytics/actions/runs/8715976528/job/23908727539?pr=10097
pytest tests/

Conda:
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event.inputs.conda == 'true')
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -281,11 +309,11 @@ jobs:

Summary:
runs-on: ubuntu-latest
needs: [HUB, Benchmarks, Tests, GPU, Conda] # Add job names that you want to check for failure
needs: [HUB, Benchmarks, Tests, GPU, RaspberryPi, Conda] # Add job names that you want to check for failure
if: always() # This ensures the job runs even if previous jobs fail
steps:
- name: Check for failure and notify
if: (needs.HUB.result == 'failure' || needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.GPU.result == 'failure' || needs.Conda.result == 'failure') && github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push')
if: (needs.HUB.result == 'failure' || needs.Benchmarks.result == 'failure' || needs.Tests.result == 'failure' || needs.GPU.result == 'failure' || needs.RaspberryPi.result == 'failure' || needs.Conda.result == 'failure' ) && github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event_name == 'push')
uses: slackapi/slack-github-action@v1.25.0
with:
payload: |
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,23 @@ jobs:
import os
import ultralytics
from ultralytics.utils.checks import check_latest_pypi_version

v_local = tuple(map(int, ultralytics.__version__.split('.')))
v_pypi = tuple(map(int, check_latest_pypi_version().split('.')))

print(f'Local version is {v_local}')
print(f'PyPI version is {v_pypi}')

d = [a - b for a, b in zip(v_local, v_pypi)] # diff
increment = (d[0] == d[1] == 0) and (0 < d[2] < 3) # only publish if patch version increments by 1 or 2

increment_patch = (d[0] == d[1] == 0) and (0 < d[2] < 3) # publish if patch version increments by 1 or 2
increment_minor = (d[0] == 0) and (d[1] == 1) and v_local[2] == 0 # publish if minor version increments

increment = increment_patch or increment_minor

os.system(f'echo "increment={increment}" >> $GITHUB_OUTPUT')
os.system(f'echo "version={ultralytics.__version__}" >> $GITHUB_OUTPUT')

if increment:
print('Local version is higher than PyPI version. Publishing new version to PyPI ✅.')
id: check_pypi
Expand Down
Loading