Spaces:
Running
Running
fix:
Browse files- api/routers/camera_stream.py +1 -1
- services/pipeline.py +7 -7
- tests/test_pipeline.py +3 -3
api/routers/camera_stream.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
from api.dependencies import get_safety_detection_model
|
| 3 |
from api.dependencies import get_detection_model, get_depth_model
|
| 4 |
import asyncio
|
|
|
|
| 1 |
+
from services.pipeline import ProcessingPipeline
|
| 2 |
from api.dependencies import get_safety_detection_model
|
| 3 |
from api.dependencies import get_detection_model, get_depth_model
|
| 4 |
import asyncio
|
services/pipeline.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
from
|
| 2 |
-
from
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
-
from
|
| 6 |
import asyncio
|
| 7 |
-
from
|
| 8 |
-
from
|
| 9 |
import cv2 as cv
|
| 10 |
import numpy as np
|
| 11 |
|
|
|
|
| 1 |
+
from api.routers.metrics import depth_duration_seconds
|
| 2 |
+
from api.routers.metrics import detection_duration_seconds
|
| 3 |
+
from api.routers.metrics import decode_duration_seconds
|
| 4 |
+
from utils.profiling import profile_step
|
| 5 |
+
from domain.detection_box_center import calculate_detection_box_center
|
| 6 |
import asyncio
|
| 7 |
+
from contracts.camera_metadata import DetectionMetadata
|
| 8 |
+
from contracts.camera_metadata import CameraMetadata
|
| 9 |
import cv2 as cv
|
| 10 |
import numpy as np
|
| 11 |
|
tests/test_pipeline.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
import pytest
|
| 3 |
import numpy as np
|
| 4 |
from unittest.mock import MagicMock, AsyncMock, patch
|
|
@@ -33,7 +33,7 @@ async def test_pipeline_success(mock_deps):
|
|
| 33 |
|
| 34 |
with (
|
| 35 |
patch("cv2.imdecode") as mock_decode,
|
| 36 |
-
patch("
|
| 37 |
):
|
| 38 |
mock_decode.return_value = np.zeros((100, 100, 3), dtype=np.uint8)
|
| 39 |
|
|
@@ -60,7 +60,7 @@ async def test_pipeline_no_detections(mock_deps):
|
|
| 60 |
|
| 61 |
with (
|
| 62 |
patch("cv2.imdecode") as mock_decode,
|
| 63 |
-
patch("
|
| 64 |
):
|
| 65 |
mock_decode.return_value = np.zeros((100, 100, 3), dtype=np.uint8)
|
| 66 |
|
|
|
|
| 1 |
+
from services.pipeline import ProcessingPipeline
|
| 2 |
import pytest
|
| 3 |
import numpy as np
|
| 4 |
from unittest.mock import MagicMock, AsyncMock, patch
|
|
|
|
| 33 |
|
| 34 |
with (
|
| 35 |
patch("cv2.imdecode") as mock_decode,
|
| 36 |
+
patch("utils.profiling.mlflow") as _,
|
| 37 |
):
|
| 38 |
mock_decode.return_value = np.zeros((100, 100, 3), dtype=np.uint8)
|
| 39 |
|
|
|
|
| 60 |
|
| 61 |
with (
|
| 62 |
patch("cv2.imdecode") as mock_decode,
|
| 63 |
+
patch("utils.profiling.mlflow") as _,
|
| 64 |
):
|
| 65 |
mock_decode.return_value = np.zeros((100, 100, 3), dtype=np.uint8)
|
| 66 |
|