Spaces:
Runtime error
Runtime error
File size: 623 Bytes
749f5b3 cc6c2a0 75ae33e cf78bc3 75ae33e b19faa8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import pytest
import numpy as np
import cv2
from app import YOLOv8Model
import pandas as pd
def test_model_initialization():
try:
model = YOLOv8Model()
assert model is not None, "YOLOv8 model failed to initialize"
except Exception as e:
pytest.fail(f"YOLO model initialization failed: {e}")
def test_inference():
frame = np.zeros((640, 640, 3), dtype=np.uint8)
model = YOLOv8Model()
result = model.predict(frame)
assert isinstance(result, pd.DataFrame), "Expected results in DataFrame format"
assert "name" in result.columns, "Violation class (name) missing in results" |