Skip to content

Commit f6d207d

Browse files
committed
Clean up
1 parent 4b8ad23 commit f6d207d

File tree

4 files changed

+64
-8
lines changed

4 files changed

+64
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Binary Classification Detectors
2+
3+
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.
4+
5+
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?".
6+
7+
```python
8+
from groundlight import Groundlight
9+
gl = Groundlight()
10+
11+
# highlight-start
12+
detector = gl.create_detector(
13+
name="eagle-detector",
14+
query="Is there an eagle visible?",
15+
confidence_threshold=0.9,
16+
)
17+
# highlight-end
18+
```
19+
20+
## Submit an Image Query to a Binary Classification Detector
21+
22+
Now that you have created a binary classification detector, you can submit an image query to it.
23+
24+
```python notest
25+
from groundlight import Groundlight
26+
gl = Groundlight()
27+
28+
detector = gl.get_detector_by_name("eagle-detector")
29+
30+
# highlight-start
31+
# Check if an eagle is visible in an image
32+
image_query = gl.submit_image_query(detector, "path/to/image.jpg")
33+
# highlight-end
34+
35+
print(f"Result: {image_query.result.label}")
36+
print(f"Confidence: {image_query.result.confidence}")
37+
```
38+
39+
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.
40+
41+
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.
42+
43+
## Add a label to a Binary Classification Detector
44+
45+
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.
46+
47+
```python notest
48+
from groundlight import Groundlight
49+
gl = Groundlight()
50+
51+
# highlight-start
52+
# Add a binary label to the image query from the previous example
53+
gl.add_label(image_query, label="YES")
54+
# highlight-end
55+
```

docs/docs/answer-modes/2-multi-class-detectors.md docs/docs/answer-modes/2-multi-choice-detectors.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [BETA] Multi-Class Detectors
1+
# Multiple Choice (Choose One) Detectors
22

33
If you want to classify images into multiple categories, you can create a multi-class detector.
44

@@ -20,9 +20,9 @@ detector = gl_exp.create_multiclass_detector(
2020
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.
2121
:::
2222

23-
<!-- :::note
23+
:::note
2424
Multi-Class Detectors are available on [Business and Enterprise plans](https://www.groundlight.ai/pricing).
25-
::: -->
25+
:::
2626

2727
## Submit an Image Query to a Multi-Class Detector
2828

docs/docs/answer-modes/3-counting-detectors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Counting Detectors
1+
# Count Detectors
22

33
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.
44

docs/docs/answer-modes/answer-modes.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
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.
44

5-
1. [Binary Detectors](1-binary-detectors.md)
6-
2. [Multi-class Detectors](2-multi-class-detectors.md)
7-
3. [Counting Detectors](3-counting-detectors.md)
5+
- **[Binary Detectors](1-binary-detectors.md)**: Learn how to create detectors that answer yes/no questions about images.
6+
- **[Multiple Choice (Choose One) Detectors](2-multi-choice-detectors.md)**: Create detectors that select one answer from a predefined list of options.
7+
- **[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.
8+
<!-- 4. [Text Recognition Detectors](4-text-recognition-detectors.md) -->
89

9-
<!-- TODO: text, object detection modes -->
10+
<!-- TODO: object detection modes -->

0 commit comments

Comments
 (0)