fix(demo): correct window start metadata and test unpacking
Use buffered frame indices for emitted window bounds to stay accurate across detection gaps, and align select_person tests with the 4-field return contract introduced for frame-space bbox support.
This commit is contained in:
@@ -234,7 +234,7 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
mask, bbox, tid = result
|
||||
mask, bbox, _, tid = result
|
||||
assert mask.shape == (100, 100)
|
||||
assert bbox == (10, 10, 50, 90)
|
||||
assert tid == 42
|
||||
@@ -257,7 +257,7 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
mask, bbox, tid = result
|
||||
mask, bbox, _, tid = result
|
||||
assert bbox == (0, 0, 30, 30) # Largest box
|
||||
assert tid == 2 # Corresponding track ID
|
||||
|
||||
@@ -327,7 +327,7 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
_, bbox, tid = result
|
||||
_, bbox, _, tid = result
|
||||
assert bbox == (10, 10, 50, 90)
|
||||
assert tid == 1
|
||||
|
||||
@@ -341,11 +341,10 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
mask, _, _ = result
|
||||
mask, _, _, _ = result
|
||||
# Should be 2D (extracted from expanded 3D)
|
||||
assert mask.shape == (100, 100)
|
||||
|
||||
|
||||
def test_select_person_tensor_cpu_inputs(self) -> None:
|
||||
"""Tensor-backed inputs (CPU) should work correctly."""
|
||||
boxes = torch.tensor([[10.0, 10.0, 50.0, 90.0]], dtype=torch.float32)
|
||||
@@ -356,7 +355,7 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
mask, bbox, tid = result
|
||||
mask, bbox, _, tid = result
|
||||
assert mask.shape == (100, 100)
|
||||
assert bbox == (10, 10, 50, 90)
|
||||
assert tid == 42
|
||||
@@ -372,7 +371,7 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
mask, bbox, tid = result
|
||||
mask, bbox, _, tid = result
|
||||
assert mask.shape == (100, 100)
|
||||
assert bbox == (10, 10, 50, 90)
|
||||
assert tid == 42
|
||||
@@ -394,6 +393,6 @@ class TestSelectPerson:
|
||||
result = select_person(results)
|
||||
|
||||
assert result is not None
|
||||
_, bbox, tid = result
|
||||
_, bbox, _, tid = result
|
||||
assert bbox == (0, 0, 30, 30) # Largest box
|
||||
assert tid == 2 # Corresponding track ID
|
||||
|
||||
Reference in New Issue
Block a user