Add dockerized detector and UI cleanup

This commit is contained in:
2026-04-11 16:45:22 +02:00
parent 3b5a9e8635
commit ecbf948a74
7 changed files with 148 additions and 26 deletions

View File

@@ -1,6 +1,6 @@
import numpy as np
from app.vision import BBox, crop_image, detect_salient_object, square_bbox
from app.vision import BBox, crop_image, detect_salient_object, select_primary_bbox, square_bbox
def test_square_bbox_is_square_and_inside_bounds():
@@ -28,3 +28,10 @@ def test_detect_salient_object_finds_rectangle():
assert bbox is not None
assert bbox.w >= 45
assert bbox.h >= 45
def test_select_primary_bbox_falls_back_when_detector_disabled():
image = np.zeros((100, 120, 3), dtype=np.uint8)
bbox, method = select_primary_bbox(image, detector="center")
assert method == "center_fallback"
assert bbox.w == bbox.h