From 5ce6cacf7d81703d222ee7e6cc74bccc25744a49 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Mon, 2 Dec 2024 13:56:45 -0800 Subject: [PATCH] relocate the quick answers advice --- docs/docs/guide/4-submitting-image-queries.md | 3 +++ docs/docs/guide/5-managing-confidence.md | 17 +++-------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/docs/guide/4-submitting-image-queries.md b/docs/docs/guide/4-submitting-image-queries.md index eabc53de..e2e01d9d 100644 --- a/docs/docs/guide/4-submitting-image-queries.md +++ b/docs/docs/guide/4-submitting-image-queries.md @@ -52,6 +52,7 @@ image_query = gl.ask_confident(detector=detector, image="path/to/image.jpg") ### Get the first available answer, regardless of confidence `ask_ml` evaluates an image with Groundlight and returns the first answer Groundlight can provide, agnostic of confidence. There is no wait period when using this method. It is called `ask_ml` because our machine learning models are earliest on our escalation ladder and thus always the fastest to respond. + ```python notest from groundlight import Groundlight @@ -63,6 +64,8 @@ image_query = gl.ask_ml(detector=detector, image="path/to/image.jpg") # highlight-end ``` +When using this method, low-confidence Image Queries will still be escalated to human review - this allows our models to continue to improve over time. + ### Submit an ImageQuery asynchronously `ask_async` is a convenience method for submitting an `ImageQuery` asynchronously. This is equivalent to calling `submit_image_query` with `want_async=True` and `wait=0`. Use `get_image_query` to retrieve the `result` of the ImageQuery. diff --git a/docs/docs/guide/5-managing-confidence.md b/docs/docs/guide/5-managing-confidence.md index 614e8980..f4036389 100644 --- a/docs/docs/guide/5-managing-confidence.md +++ b/docs/docs/guide/5-managing-confidence.md @@ -28,7 +28,6 @@ gl = Groundlight() image_url = "https://www.photos-public-domain.com/wp-content/uploads/2010/11/over_flowing_garbage_can.jpg" image = Image.open(requests.get(image_url, stream=True).raw) - d = gl.get_or_create_detector( name="trash", query="Is the trash can full?", @@ -53,20 +52,10 @@ print(f"The confidence is {image_query.result.confidence}") :::tip -Tuning confidence_threshold lets you balance accuracy against latency. +Tuning the `confidence_threshold` allows you to balance accuracy with response time. -Higher confidence levels lead to greater accuracy but typically result in increased latency. Additionally, achieving higher confidence necessitates more labels, which can raise labor costs. +Higher confidence thresholds result in more accurate predictions but can increase latency. Achieving these higher confidence levels often requires more labels, which can increase labor costs. -Over time, our models will improve and become more confident, allowing you to achieve higher confidence levels more quickly while also reducing costs. +As our models improve over time, they will become more confident, enabling you to receive higher-confidence answers more quickly and at a lower cost. ::: - -## When Quick Answers are Needed - -To execute an image query as fast as possible and get the first available answer regardless of confidence, use the `ask_ml` method (equivalent to setting `wait=0`). This method returns the first answer Groundlight can provide without waiting for the query to reach a specific confidence level. - -```python notest continuation -image_query = gl.ask_ml(detector=d, image=image) -``` - -When using this method, low-confidence Image Queries will still be escalated to human review - this allows our models to continue to improve over time. \ No newline at end of file