Restrict ONNX ExecutionProviders (#18400)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
9935b45377
commit
c9a48b281e
6 changed files with 23 additions and 20 deletions
|
|
@ -3,18 +3,20 @@
|
|||
import cv2
|
||||
import pytest
|
||||
|
||||
from tests import TMP
|
||||
from ultralytics import YOLO, solutions
|
||||
from ultralytics.utils import ASSETS_URL, WEIGHTS_DIR
|
||||
from ultralytics.utils.downloads import safe_download
|
||||
|
||||
MAJOR_SOLUTIONS_DEMO = "https://github.com/ultralytics/assets/releases/download/v0.0.0/solutions_ci_demo.mp4"
|
||||
WORKOUTS_SOLUTION_DEMO = "https://github.com/ultralytics/assets/releases/download/v0.0.0/solution_ci_pose_demo.mp4"
|
||||
DEMO_VIDEO = "solutions_ci_demo.mp4"
|
||||
POSE_VIDEO = "solution_ci_pose_demo.mp4"
|
||||
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_major_solutions():
|
||||
"""Test the object counting, heatmap, speed estimation and queue management solution."""
|
||||
safe_download(url=MAJOR_SOLUTIONS_DEMO)
|
||||
cap = cv2.VideoCapture("solutions_ci_demo.mp4")
|
||||
safe_download(url=f"{ASSETS_URL}/{DEMO_VIDEO}", dir=TMP)
|
||||
cap = cv2.VideoCapture(str(TMP / DEMO_VIDEO))
|
||||
assert cap.isOpened(), "Error reading video file"
|
||||
region_points = [(20, 400), (1080, 400), (1080, 360), (20, 360)]
|
||||
counter = solutions.ObjectCounter(region=region_points, model="yolo11n.pt", show=False) # Test object counter
|
||||
|
|
@ -42,8 +44,8 @@ def test_major_solutions():
|
|||
cap.release()
|
||||
|
||||
# Test workouts monitoring
|
||||
safe_download(url=WORKOUTS_SOLUTION_DEMO)
|
||||
cap1 = cv2.VideoCapture("solution_ci_pose_demo.mp4")
|
||||
safe_download(url=f"{ASSETS_URL}/{POSE_VIDEO}", dir=TMP)
|
||||
cap1 = cv2.VideoCapture(str(TMP / POSE_VIDEO))
|
||||
assert cap1.isOpened(), "Error reading video file"
|
||||
gym = solutions.AIGym(line_width=2, kpts=[5, 11, 13], show=False)
|
||||
while cap1.isOpened():
|
||||
|
|
@ -59,9 +61,9 @@ def test_instance_segmentation():
|
|||
"""Test the instance segmentation solution."""
|
||||
from ultralytics.utils.plotting import Annotator, colors
|
||||
|
||||
model = YOLO("yolo11n-seg.pt")
|
||||
model = YOLO(WEIGHTS_DIR / "yolo11n-seg.pt")
|
||||
names = model.names
|
||||
cap = cv2.VideoCapture("solutions_ci_demo.mp4")
|
||||
cap = cv2.VideoCapture(TMP / DEMO_VIDEO)
|
||||
assert cap.isOpened(), "Error reading video file"
|
||||
while cap.isOpened():
|
||||
success, im0 = cap.read()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue