From 47679020008090a6946b787e968d53a43927039c Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sun, 19 Nov 2023 23:14:15 +0100 Subject: [PATCH] Isolate YouTube to `--slow` tests on schedule (#6441) Signed-off-by: Glenn Jocher Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .github/workflows/publish.yml | 7 +++++-- docs/overrides/stylesheets/style.css | 2 ++ tests/test_python.py | 14 +++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2e972bc4..b9e76ff0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -65,6 +65,7 @@ jobs: if: (github.event_name == 'push' || github.event.inputs.docs == 'true') && github.repository == 'ultralytics/ultralytics' && github.actor == 'glenn-jocher' env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + INDEXNOW_KEY: ${{ secrets.INDEXNOW_KEY_DOCS }} run: | python docs/build_docs.py git config --global user.name "Glenn Jocher" @@ -74,9 +75,11 @@ jobs: git checkout gh-pages || git checkout -b gh-pages rm -rf * cp -R ../site/* . + echo "$INDEXNOW_KEY" > "$INDEXNOW_KEY.txt" git add . - git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }}'" - git push https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/ultralytics/docs.git gh-pages + LATEST_HASH=$(git rev-parse --short=7 HEAD) + git commit -m "Update Docs for 'ultralytics ${{ steps.check_pypi.outputs.version }} - $LATEST_HASH'" + git push https://$PERSONAL_ACCESS_TOKEN@github.com/ultralytics/docs.git gh-pages - name: Extract PR Details run: | if [ "${{ github.event_name }}" = "pull_request" ]; then diff --git a/docs/overrides/stylesheets/style.css b/docs/overrides/stylesheets/style.css index 386dd1c0..2fa6c54b 100644 --- a/docs/overrides/stylesheets/style.css +++ b/docs/overrides/stylesheets/style.css @@ -45,6 +45,8 @@ div.highlight { } /* Language dropdown selector (default is shorter 200px in length) */ +/* Not working as activates on hover under icon area body .md-select__inner { max-height: 500px !important; } +*/ diff --git a/tests/test_python.py b/tests/test_python.py index 395e756d..83ee6596 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -132,11 +132,23 @@ def test_predict_grey_and_4ch(): f.unlink() # cleanup +@pytest.mark.slow +@pytest.mark.skipif(not ONLINE, reason='environment is offline') +def test_youtube(): + """ + Test YouTube inference. + + Marked --slow to reduce YouTube API rate limits risk. + """ + model = YOLO(MODEL) + model.predict('https://youtu.be/G17sBkb38XQ', imgsz=96, save=True) + + @pytest.mark.skipif(not ONLINE, reason='environment is offline') @pytest.mark.skipif(not IS_TMP_WRITEABLE, reason='directory is not writeable') def test_track_stream(): """ - Test YouTube streaming tracking (short 10 frame video) with non-default ByteTrack tracker. + Test streaming tracking (short 10 frame video) with non-default ByteTrack tracker. Note imgsz=160 required for tracking for higher confidence and better matches """