Isolate YouTube to --slow tests on schedule (#6441)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2023-11-19 23:14:15 +01:00 committed by GitHub
parent efd6f35192
commit 4767902000
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -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
"""