From 59b05d61497979af05ebab3075ff6e99e312dddb Mon Sep 17 00:00:00 2001 From: Harry Tung Date: Tue, 2 Jul 2024 11:12:56 -0700 Subject: [PATCH] Increased confidence threshold --- test/api/test_motdet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/api/test_motdet.py b/test/api/test_motdet.py index 28b210f6..b8a0bead 100644 --- a/test/api/test_motdet.py +++ b/test/api/test_motdet.py @@ -252,19 +252,21 @@ def test_motion_detection_not_sufficient_if_doesnt_meet_conf_threshold(gl: Groun or base_iq_response.result.confidence == 1.0 ): pytest.skip("This test requires that the cached image query response has a confidence < 1.0") + + new_response_confidence_threshold = base_iq_response.result.confidence + 1e-3, # Require a higher confidence than before new_response = gl.submit_image_query( detector=detector.id, image=original_image, patience_time=30.0, - confidence_threshold=base_iq_response.result.confidence + 1e-5, # Require a higher confidence than before + confidence_threshold=new_response_confidence_threshold, ) assert new_response.id != base_iq_response.id, "ImageQuery id should be different whether or not motion det is run" # If the response id starts with iqe, check if the confidence is higher than we have specified if new_response.id.startswith("iqe_"): - assert (base_iq_response.result.confidence + 1e-5) < new_response.result.confidence, ( + assert new_response_confidence_threshold <= new_response.result.confidence, ( "ImageQuery id should start with 'iq_' because it was created on the cloud, " "because the cached mot det response did not meet the confidence threshold" )