Skip to content

Commit

Permalink
Merge branch 'integration-tests' of https://github.com/groundlight/ed…
Browse files Browse the repository at this point in the history
…ge-endpoint into integration-tests
  • Loading branch information
roxanne-o committed Jan 24, 2025
2 parents 576c925 + e78c8f0 commit 9eb5663
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions test/integration/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import argparse
import random
import time

from groundlight import Groundlight, GroundlightClientError
from model import Detector

Expand Down Expand Up @@ -85,10 +86,12 @@ def submit_initial(detector: Detector) -> str:
# a bit dependent on the current default model,
# but that one always defaults to 0.5 confidence at first.

assert 0.5 <= iq_yes.result.confidence <= 0.55, \
f"Expected confidence to be between 0.5 and 0.55, but got {iq_yes.result.confidence}"
assert 0.5 <= iq_no.result.confidence <= 0.55, \
f"Expected confidence to be between 0.5 and 0.55, but got {iq_no.result.confidence}"
assert (
0.5 <= iq_yes.result.confidence <= 0.55
), f"Expected confidence to be between 0.5 and 0.55, but got {iq_yes.result.confidence}"
assert (
0.5 <= iq_no.result.confidence <= 0.55
), f"Expected confidence to be between 0.5 and 0.55, but got {iq_no.result.confidence}"


def improve_model(detector: Detector):
Expand All @@ -112,15 +115,15 @@ def submit_final(detector: Detector):
iq_no = _submit_dog(detector, confidence_threshold=0.5)
end_time = time.time()
print(f"Time taken to get high confidence response from edge: {end_time - start_time} seconds")
assert iq_yes.result.confidence > ACCETABLE_TRAINED_CONFIDENCE, \
f"Expected confidence to be greater than {ACCETABLE_TRAINED_CONFIDENCE}, but got {iq_yes.result.confidence}"
assert iq_yes.result.label.value == "YES", \
f"Expected label to be YES, but got {iq_yes.result.label.value}"

assert iq_no.result.confidence > ACCETABLE_TRAINED_CONFIDENCE, \
f"Expected confidence to be greater than {ACCETABLE_TRAINED_CONFIDENCE}, but got {iq_no.result.confidence}"
assert iq_no.result.label.value == "NO", \
f"Expected label to be NO, but got {iq_no.result.label.value}"
assert (
iq_yes.result.confidence > ACCETABLE_TRAINED_CONFIDENCE
), f"Expected confidence to be greater than {ACCETABLE_TRAINED_CONFIDENCE}, but got {iq_yes.result.confidence}"
assert iq_yes.result.label.value == "YES", f"Expected label to be YES, but got {iq_yes.result.label.value}"

assert (
iq_no.result.confidence > ACCETABLE_TRAINED_CONFIDENCE
), f"Expected confidence to be greater than {ACCETABLE_TRAINED_CONFIDENCE}, but got {iq_no.result.confidence}"
assert iq_no.result.label.value == "NO", f"Expected label to be NO, but got {iq_no.result.label.value}"


def _submit_cat(detector: Detector, confidence_threshold: float, wait: int = None):
Expand Down

0 comments on commit 9eb5663

Please sign in to comment.