Add dockerized detector and UI cleanup
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user