mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 08:56:32 +00:00
[AZ-180] Refactor detection event handling and improve SSE support
- Updated the detection image endpoint to require a channel ID for event streaming. - Introduced a new endpoint for streaming detection events, allowing clients to receive real-time updates. - Enhanced the internal buffering mechanism for detection events to manage multiple channels. - Refactored the inference module to support the new event handling structure. Made-with: Cursor
This commit is contained in:
@@ -28,32 +28,22 @@ def _assert_no_same_label_near_duplicate_centers(detections):
|
||||
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_ft_p_04_gsd_based_tiling_ac1(http_client, image_large, warm_engine, auth_headers):
|
||||
config = json.dumps(_GSD)
|
||||
r = http_client.post(
|
||||
"/detect/image",
|
||||
files={"file": ("img.jpg", image_large, "image/jpeg")},
|
||||
data={"config": config},
|
||||
headers=auth_headers,
|
||||
def test_ft_p_04_gsd_based_tiling_ac1(image_detect, image_large, warm_engine):
|
||||
body, _ = image_detect(
|
||||
image_large, "img.jpg",
|
||||
config=json.dumps(_GSD),
|
||||
timeout=_TILING_TIMEOUT,
|
||||
)
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert isinstance(body, list)
|
||||
_assert_coords_normalized(body)
|
||||
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_ft_p_16_tile_boundary_deduplication_ac2(http_client, image_large, warm_engine, auth_headers):
|
||||
config = json.dumps({**_GSD, "big_image_tile_overlap_percent": 20})
|
||||
r = http_client.post(
|
||||
"/detect/image",
|
||||
files={"file": ("img.jpg", image_large, "image/jpeg")},
|
||||
data={"config": config},
|
||||
headers=auth_headers,
|
||||
def test_ft_p_16_tile_boundary_deduplication_ac2(image_detect, image_large, warm_engine):
|
||||
body, _ = image_detect(
|
||||
image_large, "img.jpg",
|
||||
config=json.dumps({**_GSD, "big_image_tile_overlap_percent": 20}),
|
||||
timeout=_TILING_TIMEOUT,
|
||||
)
|
||||
assert r.status_code == 200
|
||||
body = r.json()
|
||||
assert isinstance(body, list)
|
||||
_assert_no_same_label_near_duplicate_centers(body)
|
||||
|
||||
Reference in New Issue
Block a user