ultralytics 8.1.44 add IS_RASPBERRYPI and constants refactor (#9827)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
3f34a7c3af
commit
7d891a4aa4
43 changed files with 146 additions and 141 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import sys
|
||||
from unittest import mock
|
||||
|
||||
from ultralytics import YOLO
|
||||
from ultralytics.cfg import get_cfg
|
||||
from ultralytics.engine.exporter import Exporter
|
||||
|
|
@ -52,7 +53,7 @@ def test_detect():
|
|||
pred.add_callback("on_predict_start", test_func)
|
||||
assert test_func in pred.callbacks["on_predict_start"], "callback test failed"
|
||||
# Confirm there is no issue with sys.argv being empty.
|
||||
with mock.patch.object(sys, 'argv', []):
|
||||
with mock.patch.object(sys, "argv", []):
|
||||
result = pred(source=ASSETS, model=f"{MODEL}.pt")
|
||||
assert len(result), "predictor test failed"
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ def test_mlflow():
|
|||
@pytest.mark.skipif(not check_requirements("mlflow", install=False), reason="mlflow not installed")
|
||||
def test_mlflow_keep_run_active():
|
||||
import os
|
||||
|
||||
import mlflow
|
||||
|
||||
"""Test training with MLflow tracking enabled."""
|
||||
|
|
|
|||
|
|
@ -514,7 +514,8 @@ def test_utils_files():
|
|||
@pytest.mark.slow
|
||||
def test_utils_patches_torch_save():
|
||||
"""Test torch_save backoff when _torch_save throws RuntimeError."""
|
||||
from unittest.mock import patch, MagicMock
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from ultralytics.utils.patches import torch_save
|
||||
|
||||
mock = MagicMock(side_effect=RuntimeError)
|
||||
|
|
@ -651,9 +652,8 @@ def test_yolo_world():
|
|||
from ultralytics.models.yolo.world.train_world import WorldTrainerFromScratch
|
||||
|
||||
model = YOLO("yolov8s-worldv2.yaml") # no YOLOv8n-world model yet
|
||||
data = dict(train=dict(yolo_data=["coco8.yaml"]), val=dict(yolo_data=["coco8.yaml"]))
|
||||
model.train(
|
||||
data=data,
|
||||
data={"train": {"yolo_data": ["coco8.yaml"]}, "val": {"yolo_data": ["coco8.yaml"]}},
|
||||
epochs=2,
|
||||
imgsz=32,
|
||||
cache="disk",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue