From d2e7190da4f31337bffd4be3a6fafa252c5e1355 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Fri, 14 Mar 2025 15:36:15 -0700 Subject: [PATCH 01/11] [docs] Add detector modes section to guide --- docs/docs/guide/{9-alerts.md => 10-alerts.md} | 0 docs/docs/guide/5-detector-modalities.md | 168 ++++++++++++++++++ ...confidence.md => 6-managing-confidence.md} | 0 ...andling-errors.md => 7-handling-errors.md} | 0 ...{7-async-queries.md => 8-async-queries.md} | 0 docs/docs/guide/{8-edge.md => 9-edge.md} | 0 docs/docs/guide/guide.md | 13 +- 7 files changed, 175 insertions(+), 6 deletions(-) rename docs/docs/guide/{9-alerts.md => 10-alerts.md} (100%) create mode 100644 docs/docs/guide/5-detector-modalities.md rename docs/docs/guide/{5-managing-confidence.md => 6-managing-confidence.md} (100%) rename docs/docs/guide/{6-handling-errors.md => 7-handling-errors.md} (100%) rename docs/docs/guide/{7-async-queries.md => 8-async-queries.md} (100%) rename docs/docs/guide/{8-edge.md => 9-edge.md} (100%) diff --git a/docs/docs/guide/9-alerts.md b/docs/docs/guide/10-alerts.md similarity index 100% rename from docs/docs/guide/9-alerts.md rename to docs/docs/guide/10-alerts.md diff --git a/docs/docs/guide/5-detector-modalities.md b/docs/docs/guide/5-detector-modalities.md new file mode 100644 index 00000000..0636b9e1 --- /dev/null +++ b/docs/docs/guide/5-detector-modalities.md @@ -0,0 +1,168 @@ +# Detector Answer Modalities + +Groundlight supports a variety of answer modalities. Thus far, all of the examples we have provided are for binary classification detectors. However, Groundlight also supports counting, multi-class, and object detection, text detectors. + +## Counting Detectors + +Counting detectors are used to count the number of objects in an image. Groundlight's counting detectors also return bounding boxes around the objects they count. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +detector = gl_exp.create_counting_detector( + name="car-counter", + query="How many cars are in the parking lot?", + max_count=20, + confidence_threshold=0.2, +) +# highlight-end +``` + +Counting detectors should be provided with a query that asks "how many" objects are in the image. + +A maximum count (of 50 or fewer) must be specified when creating a counting detector. This is the maximum number of objects that the detector will count in an image. Groundlight's ML models are optimized for counting up to 20 objects, but you can increase the maximum count to 50 if needed. If you have an application that requires counting more than 50 objects, please [contact us](mailto:support@groundlight.ai). + +:::note +Counting Detectors are available on [Business and Enterprise plans](https://www.groundlight.ai/pricing). +::: + +### Submit an Image Query to a Counting Detector + +Now that you have created a counting detector, you can submit an image query to it. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +# Use the detector from the previous example to count the number of cars in an image +image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg") +# highlight-end + +print(f"Counted {image_query.result.count} cars") +print(f"Confidence: {image_query.result.confidence}") +print(f"Bounding Boxes: {image_query.rois}") +``` + +In the case of counting detectors, the `count` attribute of the result object will contain the number of objects counted in the image. The `confidence` attribute represents the confidence level in the specific count. Note that this implies that confidences may be lower (on average) for counting detectors with a higher maximum count. + + + +:::tip Drawing Bounding Boxes +You can visualize the bounding boxes returned by counting detectors using a library like OpenCV. Here's an example of how to draw bounding boxes on an image: + +```python notest +import cv2 +import numpy as np + +def draw_bounding_boxes(image_path, rois): + """ + Draw bounding boxes on an image based on ROIs returned from a counting detector. + + Args: + image_path: Path to the image file + rois: List of ROI objects returned from image_query.rois + """ + image = cv2.imread(image_path) + if image is None: + raise ValueError(f"Could not read image from {image_path}") + height, width = image.shape[:2] + + # Draw bounding boxes + for roi in rois: + x1 = int(roi.geometry.left * width) + y1 = int(roi.geometry.top * height) + x2 = int(roi.geometry.right * width) + y2 = int(roi.geometry.bottom * height) + cv2.rectangle(image, (x1, y1), (x2, y2), (0, 255, 0), 2) + label_text = f"{roi.label}: {roi.score:.2f}" + cv2.putText(image, label_text, (x1, y1-10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2) + + # Display the image + cv2.imshow("Image with Bounding Boxes", image) + cv2.waitKey(0) + cv2.destroyAllWindows() + +# Example usage: +# image_query = gl.submit_image_query(detector, "path/to/image.jpg") +# draw_bounding_boxes("path/to/image.jpg", image_query.rois) +``` +::: + +### Add a label to a Counting Detector + +The Groundlight API allows you to add labels to image queries, including Region of Interest (ROI) data. +When adding a label to a counting detector, if you include ROIs, the number of ROIs should match +the count you are labeling. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +# Add a count label with corresponding ROIs to an image query +roi1 = gl_exp.create_roi("car", (0.1, 0.2), (0.2, 0.3)) +roi2 = gl_exp.create_roi("car", (0.4, 0.4), (0.5, 0.6)) +roi3 = gl_exp.create_roi("car", (0.6, 0.5), (0.8, 0.9)) +rois = [roi1, roi2, roi3] +gl_exp.add_label(image_query, label=len(rois), rois=rois) +# highlight-end +``` + +## [BETA] Multi-Class Detectors + +If you want to classify images into multiple categories, you can create a multi-class detector. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd", "Other"] +detector = gl_exp.create_multiclass_detector( + name, query="What kind of dog is this?", + class_names=class_names, +) +# highlight-end +``` + +:::tip +We recommend adding an "Other" class to your multi-class detector to handle cases where the image does not belong to any of the pre-defined classes. +::: + +### Submit an Image Query to a Multi-Class Detector + +Now that you have created a multi-class detector, you can submit an image query to it. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +# Use the detector from the previous example to classify the breed of a dog in an image +image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg") +# highlight-end + +print(f"Result: {image_query.result.label}") +print(f"Confidence: {image_query.result.confidence}") +``` + +Multi-class detectors return a `label` attribute in the result object, which contains the predicted class label. The `label` attribute will be one of the class names provided when creating the detector. The `confidence` attribute represents the confidence level in the predicted class, which is a value between `1/len(class_names)` and 1. + +### Add a label to a Multi-Class Detector + +To provide ground truth labels for multi-class detectors, you can specify the label of the correct class. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +# Add a multi-class label to an image query +gl_exp.add_label(image_query, label="German Shepherd") +# highlight-end +``` + + \ No newline at end of file diff --git a/docs/docs/guide/5-managing-confidence.md b/docs/docs/guide/6-managing-confidence.md similarity index 100% rename from docs/docs/guide/5-managing-confidence.md rename to docs/docs/guide/6-managing-confidence.md diff --git a/docs/docs/guide/6-handling-errors.md b/docs/docs/guide/7-handling-errors.md similarity index 100% rename from docs/docs/guide/6-handling-errors.md rename to docs/docs/guide/7-handling-errors.md diff --git a/docs/docs/guide/7-async-queries.md b/docs/docs/guide/8-async-queries.md similarity index 100% rename from docs/docs/guide/7-async-queries.md rename to docs/docs/guide/8-async-queries.md diff --git a/docs/docs/guide/8-edge.md b/docs/docs/guide/9-edge.md similarity index 100% rename from docs/docs/guide/8-edge.md rename to docs/docs/guide/9-edge.md diff --git a/docs/docs/guide/guide.md b/docs/docs/guide/guide.md index bbb77ea6..ba3a71d7 100644 --- a/docs/docs/guide/guide.md +++ b/docs/docs/guide/guide.md @@ -6,11 +6,12 @@ On the following pages, we'll guide you through the process of building applicat - **[Grabbing images](2-grabbing-images.md)**: Understand the intricacies of how to submit images from various input sources to Groundlight. - **[Working with detectors](3-working-with-detectors.md)**: Learn how to create, configure, and use detectors in your Groundlight-powered applications. - **[Submitting image queries](4-submitting-image-queries.md)**: Submit images to Groundlight for analysis and retrieve the results. -- **[Confidence levels](5-managing-confidence.md)**: Master how to control the trade-off of latency against accuracy by configuring the desired confidence level for your detectors. -- **[Handling errors](6-handling-errors.md)**: Understand how to handle and troubleshoot HTTP errors (`ApiException`) that may occur while using Groundlight. -- **[Asynchronous queries](7-async-queries.md)**: Groundlight makes it easy to submit asynchronous queries. Learn how to submit queries asynchronously and retrieve the results later. -- **[Using Groundlight on the edge](8-edge.md)**: Discover how to deploy Groundlight in edge computing environments for improved performance and reduced latency. -- **[Alerts](9-alerts.md)**: Learn how to set up alerts to notify you via text (SMS) or email when specific conditions are met in your visual applications. -- **[Industrial applications](../sample-applications/4-industrial.md)**: Learn how to apply modern natural-language-based computer vision to your industrial and manufacturing applications. +- **[Detector answer modalities](5-detector-modalities.md)**: Answer counting and multi-classification queries with Groundlight. +- **[Confidence levels](6-managing-confidence.md)**: Master how to control the trade-off of latency against accuracy by configuring the desired confidence level for your detectors. +- **[Handling errors](7-handling-errors.md)**: Understand how to handle and troubleshoot HTTP errors (`ApiException`) that may occur while using Groundlight. +- **[Asynchronous queries](8-async-queries.md)**: Groundlight makes it easy to submit asynchronous queries. Learn how to submit queries asynchronously and retrieve the results later. +- **[Using Groundlight on the edge](9-edge.md)**: Discover how to deploy Groundlight in edge computing environments for improved performance and reduced latency. +- **[Alerts](10-alerts.md)**: Learn how to set up alerts to notify you via text (SMS) or email when specific conditions are met in your visual applications. + By exploring these resources and sample applications, you'll be well on your way to building powerful visual applications using Groundlight's computer vision and natural language capabilities. From 27d1a45d92a39b4558fcd80931cd382a1e4c16bb Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Fri, 14 Mar 2025 15:39:58 -0700 Subject: [PATCH 02/11] Clean up --- docs/docs/guide/3-working-with-detectors.md | 35 --------------------- docs/docs/guide/5-detector-modalities.md | 19 ++++++----- 2 files changed, 12 insertions(+), 42 deletions(-) diff --git a/docs/docs/guide/3-working-with-detectors.md b/docs/docs/guide/3-working-with-detectors.md index 30628959..a9651306 100644 --- a/docs/docs/guide/3-working-with-detectors.md +++ b/docs/docs/guide/3-working-with-detectors.md @@ -59,38 +59,3 @@ detectors = gl.list_detectors() detectors = gl.list_detectors(page=1, page_size=5) # highlight-end ``` - -### [BETA] Create a Counting Detector -So far, all of the detectors we've created have been binary classification detectors. But what if you want to count the number of objects in an image? You can create a counting detector to do just that. Counting detectors also return bounding boxes around the objects they count. - -:::note - -Counting Detectors are available on [Pro, Business, and Enterprise plans](https://www.groundlight.ai/pricing). - -::: - -```python notest -from groundlight import ExperimentalApi - -gl_experimental = ExperimentalApi() - -# highlight-start -detector = gl_experimental.create_counting_detector(name="your_detector_name", query="How many cars are in the parking lot?", max_count=20) -# highlight-end -``` - -### [BETA] Create a Multi-Class Detector -If you want to classify images into multiple categories, you can create a multi-class detector. - -```python notest -from groundlight import ExperimentalApi - -gl_experimental = ExperimentalApi() - -# highlight-start -class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd"] -detector = gl_experimental.create_multiclass_detector( - name, query="What kind of dog is this?", class_names=class_names -) -# highlight-end -``` \ No newline at end of file diff --git a/docs/docs/guide/5-detector-modalities.md b/docs/docs/guide/5-detector-modalities.md index 0636b9e1..6f5cf2ac 100644 --- a/docs/docs/guide/5-detector-modalities.md +++ b/docs/docs/guide/5-detector-modalities.md @@ -6,7 +6,7 @@ Groundlight supports a variety of answer modalities. Thus far, all of the exampl Counting detectors are used to count the number of objects in an image. Groundlight's counting detectors also return bounding boxes around the objects they count. -```python notest +```python from groundlight import ExperimentalApi gl_exp = ExperimentalApi() @@ -36,8 +36,10 @@ Now that you have created a counting detector, you can submit an image query to from groundlight import ExperimentalApi gl_exp = ExperimentalApi() +detector = gl_exp.get_detector_by_name("car-counter") + # highlight-start -# Use the detector from the previous example to count the number of cars in an image +# Count the number of cars in an image image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg") # highlight-end @@ -102,7 +104,7 @@ from groundlight import ExperimentalApi gl_exp = ExperimentalApi() # highlight-start -# Add a count label with corresponding ROIs to an image query +# Add a count label with corresponding ROIs to the image query from the previous example roi1 = gl_exp.create_roi("car", (0.1, 0.2), (0.2, 0.3)) roi2 = gl_exp.create_roi("car", (0.4, 0.4), (0.5, 0.6)) roi3 = gl_exp.create_roi("car", (0.6, 0.5), (0.8, 0.9)) @@ -115,14 +117,15 @@ gl_exp.add_label(image_query, label=len(rois), rois=rois) If you want to classify images into multiple categories, you can create a multi-class detector. -```python notest +```python from groundlight import ExperimentalApi gl_exp = ExperimentalApi() # highlight-start class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd", "Other"] detector = gl_exp.create_multiclass_detector( - name, query="What kind of dog is this?", + name="dog-breed-detector", + query="What kind of dog is this?", class_names=class_names, ) # highlight-end @@ -140,8 +143,10 @@ Now that you have created a multi-class detector, you can submit an image query from groundlight import ExperimentalApi gl_exp = ExperimentalApi() +detector = gl_exp.get_detector_by_name("dog-breed-detector") + # highlight-start -# Use the detector from the previous example to classify the breed of a dog in an image +# Classify the breed of a dog in an image image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg") # highlight-end @@ -160,7 +165,7 @@ from groundlight import ExperimentalApi gl_exp = ExperimentalApi() # highlight-start -# Add a multi-class label to an image query +# Add a multi-class label to the image query from the previous example gl_exp.add_label(image_query, label="German Shepherd") # highlight-end ``` From d68f083eca64872287697c1cc45764f4c40bb9e5 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Fri, 14 Mar 2025 15:44:09 -0700 Subject: [PATCH 03/11] Fix broken links --- docs/docs/other-ways-to-use/1-stream-processor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/other-ways-to-use/1-stream-processor.md b/docs/docs/other-ways-to-use/1-stream-processor.md index 5842713b..87af54f5 100644 --- a/docs/docs/other-ways-to-use/1-stream-processor.md +++ b/docs/docs/other-ways-to-use/1-stream-processor.md @@ -11,7 +11,7 @@ It supports a variety of input sources, including: - Image directories - Image URLs -The Stream Processor can be combined with [Groundlight Alerts](../guide/9-alerts.md) to create a simple video analytics system. For example, you could use the Stream Processor to process a video stream from a security camera and send an alert when a person is detected. +The Stream Processor can be combined with [Groundlight Alerts](../guide/10-alerts.md) to create a simple video analytics system. For example, you could use the Stream Processor to process a video stream from a security camera and send an alert when a person is detected. ## Prerequisites: You will need: @@ -79,4 +79,4 @@ The Groundlight Stream Processor is lightweight and can be run on a Raspberry Pi ## Combining with Groundlight Alerts The Stream Processor submits frames to Groundlight, but it does not do anything with the results. -In order to build a useful alerting system, you can combine the Stream Processor with [Groundlight Alerts](../guide/9-alerts.md). +In order to build a useful alerting system, you can combine the Stream Processor with [Groundlight Alerts](../guide/10-alerts.md). From a583e4332f4e7049cbb4ad054ae8ecc05e0ff073 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Fri, 14 Mar 2025 15:46:23 -0700 Subject: [PATCH 04/11] Reword --- .../guide/{5-detector-modalities.md => 5-detector-modes.md} | 5 ++--- docs/docs/guide/guide.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) rename docs/docs/guide/{5-detector-modalities.md => 5-detector-modes.md} (94%) diff --git a/docs/docs/guide/5-detector-modalities.md b/docs/docs/guide/5-detector-modes.md similarity index 94% rename from docs/docs/guide/5-detector-modalities.md rename to docs/docs/guide/5-detector-modes.md index 6f5cf2ac..e38e7259 100644 --- a/docs/docs/guide/5-detector-modalities.md +++ b/docs/docs/guide/5-detector-modes.md @@ -1,6 +1,5 @@ -# Detector Answer Modalities - -Groundlight supports a variety of answer modalities. Thus far, all of the examples we have provided are for binary classification detectors. However, Groundlight also supports counting, multi-class, and object detection, text detectors. +# Detector Answer Modes +Groundlight offers several detector modalities to suit different computer vision tasks. While previous examples have focused on binary classification, this guide will walk you through using counting and multi-class detectors. Let's explore how these different modes can be used via the Groundlight SDK. ## Counting Detectors diff --git a/docs/docs/guide/guide.md b/docs/docs/guide/guide.md index ba3a71d7..fb75973e 100644 --- a/docs/docs/guide/guide.md +++ b/docs/docs/guide/guide.md @@ -6,7 +6,7 @@ On the following pages, we'll guide you through the process of building applicat - **[Grabbing images](2-grabbing-images.md)**: Understand the intricacies of how to submit images from various input sources to Groundlight. - **[Working with detectors](3-working-with-detectors.md)**: Learn how to create, configure, and use detectors in your Groundlight-powered applications. - **[Submitting image queries](4-submitting-image-queries.md)**: Submit images to Groundlight for analysis and retrieve the results. -- **[Detector answer modalities](5-detector-modalities.md)**: Answer counting and multi-classification queries with Groundlight. +- **[Detector answer modes](5-detector-modes.md)**: Answer counting and multi-classification queries with Groundlight. - **[Confidence levels](6-managing-confidence.md)**: Master how to control the trade-off of latency against accuracy by configuring the desired confidence level for your detectors. - **[Handling errors](7-handling-errors.md)**: Understand how to handle and troubleshoot HTTP errors (`ApiException`) that may occur while using Groundlight. - **[Asynchronous queries](8-async-queries.md)**: Groundlight makes it easy to submit asynchronous queries. Learn how to submit queries asynchronously and retrieve the results later. From 6a2811bd914a4c6a8fd0c29e3f516bf3f87d40eb Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Fri, 14 Mar 2025 15:48:08 -0700 Subject: [PATCH 05/11] Fix another broken link --- docs/docs/guide/4-submitting-image-queries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/guide/4-submitting-image-queries.md b/docs/docs/guide/4-submitting-image-queries.md index cbf9d291..97e30664 100644 --- a/docs/docs/guide/4-submitting-image-queries.md +++ b/docs/docs/guide/4-submitting-image-queries.md @@ -73,7 +73,7 @@ image_query = gl.get_image_query(id=image_query.id) # highlight-end ``` -See this [guide](./7-async-queries.md) for more information on ImageQueries submitted asynchronously. +See this [guide](./8-async-queries.md) for more information on ImageQueries submitted asynchronously. ### (Advanced) 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. From 09446a18ad7bc967b85d1e035d6b35b88175eb2a Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Mon, 17 Mar 2025 10:39:35 -0700 Subject: [PATCH 06/11] Apply suggestions from code review --- docs/docs/guide/5-detector-modes.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/docs/guide/5-detector-modes.md b/docs/docs/guide/5-detector-modes.md index e38e7259..4c344fb2 100644 --- a/docs/docs/guide/5-detector-modes.md +++ b/docs/docs/guide/5-detector-modes.md @@ -13,6 +13,7 @@ gl_exp = ExperimentalApi() detector = gl_exp.create_counting_detector( name="car-counter", query="How many cars are in the parking lot?", + class_name="car", max_count=20, confidence_threshold=0.2, ) @@ -23,6 +24,8 @@ Counting detectors should be provided with a query that asks "how many" objects A maximum count (of 50 or fewer) must be specified when creating a counting detector. This is the maximum number of objects that the detector will count in an image. Groundlight's ML models are optimized for counting up to 20 objects, but you can increase the maximum count to 50 if needed. If you have an application that requires counting more than 50 objects, please [contact us](mailto:support@groundlight.ai). +The `confidence_threshold` parameter sets the minimum confidence level required for the ML model's predictions. If the model's confidence falls below this threshold, the query will be sent for human review. Count detectors can have a `confidence_threshold` set to any value between `1/(max_count + 2)` and 1. + :::note Counting Detectors are available on [Business and Enterprise plans](https://www.groundlight.ai/pricing). ::: @@ -103,7 +106,9 @@ from groundlight import ExperimentalApi gl_exp = ExperimentalApi() # highlight-start -# Add a count label with corresponding ROIs to the image query from the previous example +# Add a count label with corresponding ROIs to the image query from the previous example. +# ROIs are specified as (left, top) and (right, bottom) coordinates, with values +# between 0 and 1 representing the percentage of the image width and height. roi1 = gl_exp.create_roi("car", (0.1, 0.2), (0.2, 0.3)) roi2 = gl_exp.create_roi("car", (0.4, 0.4), (0.5, 0.6)) roi3 = gl_exp.create_roi("car", (0.6, 0.5), (0.8, 0.9)) @@ -134,6 +139,10 @@ detector = gl_exp.create_multiclass_detector( We recommend adding an "Other" class to your multi-class detector to handle cases where the image does not belong to any of the pre-defined classes. ::: + + ### Submit an Image Query to a Multi-Class Detector Now that you have created a multi-class detector, you can submit an image query to it. From 4b8ad235f53a4f1c151378029291b46e7bbfa70b Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Wed, 19 Mar 2025 11:13:52 -0700 Subject: [PATCH 07/11] New Answer-Modes section --- docs/docs/answer-modes/1-binary-detectors.md | 0 .../answer-modes/2-multi-class-detectors.md | 60 +++++++++++++++ .../3-counting-detectors.md} | 74 +------------------ docs/docs/answer-modes/_category_.json | 4 + docs/docs/answer-modes/answer-modes.md | 9 +++ docs/docs/guide/4-submitting-image-queries.md | 2 +- ...confidence.md => 5-managing-confidence.md} | 0 ...andling-errors.md => 6-handling-errors.md} | 0 ...{8-async-queries.md => 7-async-queries.md} | 0 docs/docs/guide/{9-edge.md => 8-edge.md} | 0 docs/docs/guide/{10-alerts.md => 9-alerts.md} | 0 docs/docs/guide/_category_.json | 2 +- docs/docs/guide/guide.md | 11 ++- docs/docs/other-ways-to-use/_category_.json | 2 +- docs/docs/sample-applications/_category_.json | 2 +- 15 files changed, 86 insertions(+), 80 deletions(-) create mode 100644 docs/docs/answer-modes/1-binary-detectors.md create mode 100644 docs/docs/answer-modes/2-multi-class-detectors.md rename docs/docs/{guide/5-detector-modes.md => answer-modes/3-counting-detectors.md} (64%) create mode 100644 docs/docs/answer-modes/_category_.json create mode 100644 docs/docs/answer-modes/answer-modes.md rename docs/docs/guide/{6-managing-confidence.md => 5-managing-confidence.md} (100%) rename docs/docs/guide/{7-handling-errors.md => 6-handling-errors.md} (100%) rename docs/docs/guide/{8-async-queries.md => 7-async-queries.md} (100%) rename docs/docs/guide/{9-edge.md => 8-edge.md} (100%) rename docs/docs/guide/{10-alerts.md => 9-alerts.md} (100%) diff --git a/docs/docs/answer-modes/1-binary-detectors.md b/docs/docs/answer-modes/1-binary-detectors.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/docs/answer-modes/2-multi-class-detectors.md b/docs/docs/answer-modes/2-multi-class-detectors.md new file mode 100644 index 00000000..ff86ca1b --- /dev/null +++ b/docs/docs/answer-modes/2-multi-class-detectors.md @@ -0,0 +1,60 @@ +# [BETA] Multi-Class Detectors + +If you want to classify images into multiple categories, you can create a multi-class detector. + +```python +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd", "Other"] +detector = gl_exp.create_multiclass_detector( + name="dog-breed-detector", + query="What kind of dog is this?", + class_names=class_names, +) +# highlight-end +``` + +:::tip +We recommend adding an "Other" class to your multi-class detector to handle cases where the image does not belong to any of the pre-defined classes. +::: + + + +## Submit an Image Query to a Multi-Class Detector + +Now that you have created a multi-class detector, you can submit an image query to it. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +detector = gl_exp.get_detector_by_name("dog-breed-detector") + +# highlight-start +# Classify the breed of a dog in an image +image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg") +# highlight-end + +print(f"Result: {image_query.result.label}") +print(f"Confidence: {image_query.result.confidence}") +``` + +Multi-class detectors return a `label` attribute in the result object, which contains the predicted class label. The `label` attribute will be one of the class names provided when creating the detector. The `confidence` attribute represents the confidence level in the predicted class, which is a value between `1/len(class_names)` and 1. + +## Add a label to a Multi-Class Detector + +To provide ground truth labels for multi-class detectors, you can specify the label of the correct class. + +```python notest +from groundlight import ExperimentalApi +gl_exp = ExperimentalApi() + +# highlight-start +# Add a multi-class label to the image query from the previous example +gl_exp.add_label(image_query, label="German Shepherd") +# highlight-end +``` diff --git a/docs/docs/guide/5-detector-modes.md b/docs/docs/answer-modes/3-counting-detectors.md similarity index 64% rename from docs/docs/guide/5-detector-modes.md rename to docs/docs/answer-modes/3-counting-detectors.md index 4c344fb2..9b42c420 100644 --- a/docs/docs/guide/5-detector-modes.md +++ b/docs/docs/answer-modes/3-counting-detectors.md @@ -1,7 +1,4 @@ -# Detector Answer Modes -Groundlight offers several detector modalities to suit different computer vision tasks. While previous examples have focused on binary classification, this guide will walk you through using counting and multi-class detectors. Let's explore how these different modes can be used via the Groundlight SDK. - -## Counting Detectors +# Counting Detectors Counting detectors are used to count the number of objects in an image. Groundlight's counting detectors also return bounding boxes around the objects they count. @@ -30,7 +27,7 @@ The `confidence_threshold` parameter sets the minimum confidence level required Counting Detectors are available on [Business and Enterprise plans](https://www.groundlight.ai/pricing). ::: -### Submit an Image Query to a Counting Detector +## Submit an Image Query to a Counting Detector Now that you have created a counting detector, you can submit an image query to it. @@ -95,7 +92,7 @@ def draw_bounding_boxes(image_path, rois): ``` ::: -### Add a label to a Counting Detector +## Add a label to a Counting Detector The Groundlight API allows you to add labels to image queries, including Region of Interest (ROI) data. When adding a label to a counting detector, if you include ROIs, the number of ROIs should match @@ -115,67 +112,4 @@ roi3 = gl_exp.create_roi("car", (0.6, 0.5), (0.8, 0.9)) rois = [roi1, roi2, roi3] gl_exp.add_label(image_query, label=len(rois), rois=rois) # highlight-end -``` - -## [BETA] Multi-Class Detectors - -If you want to classify images into multiple categories, you can create a multi-class detector. - -```python -from groundlight import ExperimentalApi -gl_exp = ExperimentalApi() - -# highlight-start -class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd", "Other"] -detector = gl_exp.create_multiclass_detector( - name="dog-breed-detector", - query="What kind of dog is this?", - class_names=class_names, -) -# highlight-end -``` - -:::tip -We recommend adding an "Other" class to your multi-class detector to handle cases where the image does not belong to any of the pre-defined classes. -::: - - - -### Submit an Image Query to a Multi-Class Detector - -Now that you have created a multi-class detector, you can submit an image query to it. - -```python notest -from groundlight import ExperimentalApi -gl_exp = ExperimentalApi() - -detector = gl_exp.get_detector_by_name("dog-breed-detector") - -# highlight-start -# Classify the breed of a dog in an image -image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg") -# highlight-end - -print(f"Result: {image_query.result.label}") -print(f"Confidence: {image_query.result.confidence}") -``` - -Multi-class detectors return a `label` attribute in the result object, which contains the predicted class label. The `label` attribute will be one of the class names provided when creating the detector. The `confidence` attribute represents the confidence level in the predicted class, which is a value between `1/len(class_names)` and 1. - -### Add a label to a Multi-Class Detector - -To provide ground truth labels for multi-class detectors, you can specify the label of the correct class. - -```python notest -from groundlight import ExperimentalApi -gl_exp = ExperimentalApi() - -# highlight-start -# Add a multi-class label to the image query from the previous example -gl_exp.add_label(image_query, label="German Shepherd") -# highlight-end -``` - - \ No newline at end of file +``` \ No newline at end of file diff --git a/docs/docs/answer-modes/_category_.json b/docs/docs/answer-modes/_category_.json new file mode 100644 index 00000000..d1e461da --- /dev/null +++ b/docs/docs/answer-modes/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Answer Modes", + "position": 3 +} diff --git a/docs/docs/answer-modes/answer-modes.md b/docs/docs/answer-modes/answer-modes.md new file mode 100644 index 00000000..32812032 --- /dev/null +++ b/docs/docs/answer-modes/answer-modes.md @@ -0,0 +1,9 @@ +# Detector Answer Modes + +Groundlight offers several detector modalities to suit different computer vision tasks. While previous examples have focused on binary classification, this guide will walk you through using counting and multi-class detectors. Let's explore how these different modes can be used via the Groundlight SDK. + +1. [Binary Detectors](1-binary-detectors.md) +2. [Multi-class Detectors](2-multi-class-detectors.md) +3. [Counting Detectors](3-counting-detectors.md) + + \ No newline at end of file diff --git a/docs/docs/guide/4-submitting-image-queries.md b/docs/docs/guide/4-submitting-image-queries.md index 97e30664..cbf9d291 100644 --- a/docs/docs/guide/4-submitting-image-queries.md +++ b/docs/docs/guide/4-submitting-image-queries.md @@ -73,7 +73,7 @@ image_query = gl.get_image_query(id=image_query.id) # highlight-end ``` -See this [guide](./8-async-queries.md) for more information on ImageQueries submitted asynchronously. +See this [guide](./7-async-queries.md) for more information on ImageQueries submitted asynchronously. ### (Advanced) 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. diff --git a/docs/docs/guide/6-managing-confidence.md b/docs/docs/guide/5-managing-confidence.md similarity index 100% rename from docs/docs/guide/6-managing-confidence.md rename to docs/docs/guide/5-managing-confidence.md diff --git a/docs/docs/guide/7-handling-errors.md b/docs/docs/guide/6-handling-errors.md similarity index 100% rename from docs/docs/guide/7-handling-errors.md rename to docs/docs/guide/6-handling-errors.md diff --git a/docs/docs/guide/8-async-queries.md b/docs/docs/guide/7-async-queries.md similarity index 100% rename from docs/docs/guide/8-async-queries.md rename to docs/docs/guide/7-async-queries.md diff --git a/docs/docs/guide/9-edge.md b/docs/docs/guide/8-edge.md similarity index 100% rename from docs/docs/guide/9-edge.md rename to docs/docs/guide/8-edge.md diff --git a/docs/docs/guide/10-alerts.md b/docs/docs/guide/9-alerts.md similarity index 100% rename from docs/docs/guide/10-alerts.md rename to docs/docs/guide/9-alerts.md diff --git a/docs/docs/guide/_category_.json b/docs/docs/guide/_category_.json index 2e266ee8..f4658fde 100644 --- a/docs/docs/guide/_category_.json +++ b/docs/docs/guide/_category_.json @@ -1,4 +1,4 @@ { "label": "Guide", - "position": 3 + "position": 4 } diff --git a/docs/docs/guide/guide.md b/docs/docs/guide/guide.md index fb75973e..bb8c9b99 100644 --- a/docs/docs/guide/guide.md +++ b/docs/docs/guide/guide.md @@ -6,12 +6,11 @@ On the following pages, we'll guide you through the process of building applicat - **[Grabbing images](2-grabbing-images.md)**: Understand the intricacies of how to submit images from various input sources to Groundlight. - **[Working with detectors](3-working-with-detectors.md)**: Learn how to create, configure, and use detectors in your Groundlight-powered applications. - **[Submitting image queries](4-submitting-image-queries.md)**: Submit images to Groundlight for analysis and retrieve the results. -- **[Detector answer modes](5-detector-modes.md)**: Answer counting and multi-classification queries with Groundlight. -- **[Confidence levels](6-managing-confidence.md)**: Master how to control the trade-off of latency against accuracy by configuring the desired confidence level for your detectors. -- **[Handling errors](7-handling-errors.md)**: Understand how to handle and troubleshoot HTTP errors (`ApiException`) that may occur while using Groundlight. -- **[Asynchronous queries](8-async-queries.md)**: Groundlight makes it easy to submit asynchronous queries. Learn how to submit queries asynchronously and retrieve the results later. -- **[Using Groundlight on the edge](9-edge.md)**: Discover how to deploy Groundlight in edge computing environments for improved performance and reduced latency. -- **[Alerts](10-alerts.md)**: Learn how to set up alerts to notify you via text (SMS) or email when specific conditions are met in your visual applications. +- **[Confidence levels](5-managing-confidence.md)**: Master how to control the trade-off of latency against accuracy by configuring the desired confidence level for your detectors. +- **[Handling errors](6-handling-errors.md)**: Understand how to handle and troubleshoot HTTP errors (`ApiException`) that may occur while using Groundlight. +- **[Asynchronous queries](7-async-queries.md)**: Groundlight makes it easy to submit asynchronous queries. Learn how to submit queries asynchronously and retrieve the results later. +- **[Using Groundlight on the edge](8-edge.md)**: Discover how to deploy Groundlight in edge computing environments for improved performance and reduced latency. +- **[Alerts](9-alerts.md)**: Learn how to set up alerts to notify you via text (SMS) or email when specific conditions are met in your visual applications. By exploring these resources and sample applications, you'll be well on your way to building powerful visual applications using Groundlight's computer vision and natural language capabilities. diff --git a/docs/docs/other-ways-to-use/_category_.json b/docs/docs/other-ways-to-use/_category_.json index dc7ff00c..16f37a0d 100644 --- a/docs/docs/other-ways-to-use/_category_.json +++ b/docs/docs/other-ways-to-use/_category_.json @@ -1,5 +1,5 @@ { "label": "Alternative Deployment Options", - "position": 5, + "position": 6, "collapsed": false } \ No newline at end of file diff --git a/docs/docs/sample-applications/_category_.json b/docs/docs/sample-applications/_category_.json index f1985446..138a71ea 100644 --- a/docs/docs/sample-applications/_category_.json +++ b/docs/docs/sample-applications/_category_.json @@ -1,4 +1,4 @@ { "label": "Sample Applications", - "position": 4 + "position": 5 } From f6d207d270ed19fb4b03826f3f3920f413f0bdd9 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Wed, 19 Mar 2025 12:34:28 -0700 Subject: [PATCH 08/11] Clean up --- docs/docs/answer-modes/1-binary-detectors.md | 55 +++++++++++++++++++ ...tectors.md => 2-multi-choice-detectors.md} | 6 +- .../docs/answer-modes/3-counting-detectors.md | 2 +- docs/docs/answer-modes/answer-modes.md | 9 +-- 4 files changed, 64 insertions(+), 8 deletions(-) rename docs/docs/answer-modes/{2-multi-class-detectors.md => 2-multi-choice-detectors.md} (97%) diff --git a/docs/docs/answer-modes/1-binary-detectors.md b/docs/docs/answer-modes/1-binary-detectors.md index e69de29b..b0fc35f1 100644 --- a/docs/docs/answer-modes/1-binary-detectors.md +++ b/docs/docs/answer-modes/1-binary-detectors.md @@ -0,0 +1,55 @@ +# Binary Classification Detectors + +Binary classification detectors are used to answer yes/no questions about images. Most of Groundlight's documentation examples are for binary classification detectors, as they are the simplest type of detector. + +In order to create a binary classification detector, you need to provide a query that asks a yes/no question. For example, "Is there an eagle visible?" or "Is the door fully closed?". + +```python +from groundlight import Groundlight +gl = Groundlight() + +# highlight-start +detector = gl.create_detector( + name="eagle-detector", + query="Is there an eagle visible?", + confidence_threshold=0.9, +) +# highlight-end +``` + +## Submit an Image Query to a Binary Classification Detector + +Now that you have created a binary classification detector, you can submit an image query to it. + +```python notest +from groundlight import Groundlight +gl = Groundlight() + +detector = gl.get_detector_by_name("eagle-detector") + +# highlight-start +# Check if an eagle is visible in an image +image_query = gl.submit_image_query(detector, "path/to/image.jpg") +# highlight-end + +print(f"Result: {image_query.result.label}") +print(f"Confidence: {image_query.result.confidence}") +``` + +Binary classification detectors return a `label` attribute in the result object, which will be either `"YES"` or `"NO"`. If a query is ambiguous, it is also possible for the detector to return an `"UNCLEAR"` label. + +The `confidence` attribute represents the confidence level in the predicted label, which (for a binary classification detector) is a value between 0.5 and 1. A higher confidence score indicates that the model is more certain about its prediction. + +## Add a label to a Binary Classification Detector + +To provide ground truth labels for binary classification detectors, you can specify the label as either `"YES"`, `"NO"`, or `"UNCLEAR"`. This helps improve the accuracy of your detector over time. + +```python notest +from groundlight import Groundlight +gl = Groundlight() + +# highlight-start +# Add a binary label to the image query from the previous example +gl.add_label(image_query, label="YES") +# highlight-end +``` diff --git a/docs/docs/answer-modes/2-multi-class-detectors.md b/docs/docs/answer-modes/2-multi-choice-detectors.md similarity index 97% rename from docs/docs/answer-modes/2-multi-class-detectors.md rename to docs/docs/answer-modes/2-multi-choice-detectors.md index ff86ca1b..9e3cd47f 100644 --- a/docs/docs/answer-modes/2-multi-class-detectors.md +++ b/docs/docs/answer-modes/2-multi-choice-detectors.md @@ -1,4 +1,4 @@ -# [BETA] Multi-Class Detectors +# Multiple Choice (Choose One) Detectors If you want to classify images into multiple categories, you can create a multi-class detector. @@ -20,9 +20,9 @@ detector = gl_exp.create_multiclass_detector( We recommend adding an "Other" class to your multi-class detector to handle cases where the image does not belong to any of the pre-defined classes. ::: - +::: ## Submit an Image Query to a Multi-Class Detector diff --git a/docs/docs/answer-modes/3-counting-detectors.md b/docs/docs/answer-modes/3-counting-detectors.md index 9b42c420..610ea4db 100644 --- a/docs/docs/answer-modes/3-counting-detectors.md +++ b/docs/docs/answer-modes/3-counting-detectors.md @@ -1,4 +1,4 @@ -# Counting Detectors +# Count Detectors Counting detectors are used to count the number of objects in an image. Groundlight's counting detectors also return bounding boxes around the objects they count. diff --git a/docs/docs/answer-modes/answer-modes.md b/docs/docs/answer-modes/answer-modes.md index 32812032..f817bda1 100644 --- a/docs/docs/answer-modes/answer-modes.md +++ b/docs/docs/answer-modes/answer-modes.md @@ -2,8 +2,9 @@ Groundlight offers several detector modalities to suit different computer vision tasks. While previous examples have focused on binary classification, this guide will walk you through using counting and multi-class detectors. Let's explore how these different modes can be used via the Groundlight SDK. -1. [Binary Detectors](1-binary-detectors.md) -2. [Multi-class Detectors](2-multi-class-detectors.md) -3. [Counting Detectors](3-counting-detectors.md) +- **[Binary Detectors](1-binary-detectors.md)**: Learn how to create detectors that answer yes/no questions about images. +- **[Multiple Choice (Choose One) Detectors](2-multi-choice-detectors.md)**: Create detectors that select one answer from a predefined list of options. +- **[Count Detectors](3-counting-detectors.md)**: Use detectors to count the number of objects present in an image - and return bounding boxes around the counted objects. + - \ No newline at end of file + \ No newline at end of file From d3b880ef698fa46fab8a5fe030f7b025748cb5f3 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Wed, 19 Mar 2025 12:37:43 -0700 Subject: [PATCH 09/11] More cleanup --- docs/docs/guide/3-working-with-detectors.md | 9 ++++++--- docs/docs/other-ways-to-use/1-stream-processor.md | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/docs/guide/3-working-with-detectors.md b/docs/docs/guide/3-working-with-detectors.md index a9651306..1ad2cddd 100644 --- a/docs/docs/guide/3-working-with-detectors.md +++ b/docs/docs/guide/3-working-with-detectors.md @@ -1,6 +1,9 @@ # Working with Detectors -### Explicitly create a new detector +This guide will walk you through creating, retrieving, and managing detectors in Groundlight. Groundlight supports several detector modalities to suit different computer vision tasks - for more information on these modes, see the [Detector Answer Modes](../answer-modes/answer-modes.md) guide. + + +## Explicitly create a new detector Typically you'll use the `get_or_create_detector(name: str, query: str)` method to find an existing detector you've already created with the same name, or create a new one if it doesn't exists. But if you'd like to force creating a new detector you can also use the `create_detector(name: str, query: str)` method @@ -16,7 +19,7 @@ detector = gl.create_detector(name="your_detector_name", query="is there a hummi # highlight-end ``` -### Retrieve an existing detector +## Retrieve an existing detector To work with a detector that you've previously created, you need to retrieve it using its unique identifier. This is typical in Groundlight applications where you want to continue to use a detector you've already created. @@ -43,7 +46,7 @@ detector = gl.get_detector_by_name(name="your_detector_name") # highlight-end ``` -### List your detectors +## List your detectors To manage and interact with your detectors, you might need to list them. Groundlight provides a straightforward way to retrieve a list of detectors you've created. By default, the list is paginated to show 10 results per page, but you can customize this to suit your needs. ```python diff --git a/docs/docs/other-ways-to-use/1-stream-processor.md b/docs/docs/other-ways-to-use/1-stream-processor.md index 87af54f5..5842713b 100644 --- a/docs/docs/other-ways-to-use/1-stream-processor.md +++ b/docs/docs/other-ways-to-use/1-stream-processor.md @@ -11,7 +11,7 @@ It supports a variety of input sources, including: - Image directories - Image URLs -The Stream Processor can be combined with [Groundlight Alerts](../guide/10-alerts.md) to create a simple video analytics system. For example, you could use the Stream Processor to process a video stream from a security camera and send an alert when a person is detected. +The Stream Processor can be combined with [Groundlight Alerts](../guide/9-alerts.md) to create a simple video analytics system. For example, you could use the Stream Processor to process a video stream from a security camera and send an alert when a person is detected. ## Prerequisites: You will need: @@ -79,4 +79,4 @@ The Groundlight Stream Processor is lightweight and can be run on a Raspberry Pi ## Combining with Groundlight Alerts The Stream Processor submits frames to Groundlight, but it does not do anything with the results. -In order to build a useful alerting system, you can combine the Stream Processor with [Groundlight Alerts](../guide/10-alerts.md). +In order to build a useful alerting system, you can combine the Stream Processor with [Groundlight Alerts](../guide/9-alerts.md). From 35e98a99d7a99e89d69f61af3889b4cee29d9c20 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Wed, 19 Mar 2025 13:18:35 -0700 Subject: [PATCH 10/11] 50 -> 25 --- docs/docs/answer-modes/3-counting-detectors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/answer-modes/3-counting-detectors.md b/docs/docs/answer-modes/3-counting-detectors.md index 610ea4db..09481656 100644 --- a/docs/docs/answer-modes/3-counting-detectors.md +++ b/docs/docs/answer-modes/3-counting-detectors.md @@ -19,7 +19,7 @@ detector = gl_exp.create_counting_detector( Counting detectors should be provided with a query that asks "how many" objects are in the image. -A maximum count (of 50 or fewer) must be specified when creating a counting detector. This is the maximum number of objects that the detector will count in an image. Groundlight's ML models are optimized for counting up to 20 objects, but you can increase the maximum count to 50 if needed. If you have an application that requires counting more than 50 objects, please [contact us](mailto:support@groundlight.ai). +A maximum count (of 25 or fewer) must be specified when creating a counting detector. This is the maximum number of objects that the detector will count in an image. Groundlight's ML models are optimized for counting up to 20 objects, but you can increase the maximum count to 25 if needed. If you have an application that requires counting more than 25 objects, please [contact us](mailto:support@groundlight.ai). The `confidence_threshold` parameter sets the minimum confidence level required for the ML model's predictions. If the model's confidence falls below this threshold, the query will be sent for human review. Count detectors can have a `confidence_threshold` set to any value between `1/(max_count + 2)` and 1. From fd7e4c67c55eab4f2325dfbd322a2a0e8163b186 Mon Sep 17 00:00:00 2001 From: Tyler Romero Date: Wed, 19 Mar 2025 13:45:16 -0700 Subject: [PATCH 11/11] test cleanup --- docs/docs/answer-modes/1-binary-detectors.md | 2 +- docs/docs/answer-modes/2-multi-choice-detectors.md | 2 +- docs/docs/answer-modes/3-counting-detectors.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/answer-modes/1-binary-detectors.md b/docs/docs/answer-modes/1-binary-detectors.md index b0fc35f1..2d7c7f38 100644 --- a/docs/docs/answer-modes/1-binary-detectors.md +++ b/docs/docs/answer-modes/1-binary-detectors.md @@ -4,7 +4,7 @@ Binary classification detectors are used to answer yes/no questions about images In order to create a binary classification detector, you need to provide a query that asks a yes/no question. For example, "Is there an eagle visible?" or "Is the door fully closed?". -```python +```python notest from groundlight import Groundlight gl = Groundlight() diff --git a/docs/docs/answer-modes/2-multi-choice-detectors.md b/docs/docs/answer-modes/2-multi-choice-detectors.md index 9e3cd47f..2318302b 100644 --- a/docs/docs/answer-modes/2-multi-choice-detectors.md +++ b/docs/docs/answer-modes/2-multi-choice-detectors.md @@ -2,7 +2,7 @@ If you want to classify images into multiple categories, you can create a multi-class detector. -```python +```python notest from groundlight import ExperimentalApi gl_exp = ExperimentalApi() diff --git a/docs/docs/answer-modes/3-counting-detectors.md b/docs/docs/answer-modes/3-counting-detectors.md index 09481656..e245c3b7 100644 --- a/docs/docs/answer-modes/3-counting-detectors.md +++ b/docs/docs/answer-modes/3-counting-detectors.md @@ -2,7 +2,7 @@ Counting detectors are used to count the number of objects in an image. Groundlight's counting detectors also return bounding boxes around the objects they count. -```python +```python notest from groundlight import ExperimentalApi gl_exp = ExperimentalApi()