Skip to content

Commit 27d1a45

Browse files
committed
Clean up
1 parent d2e7190 commit 27d1a45

File tree

2 files changed

+12
-42
lines changed

2 files changed

+12
-42
lines changed

docs/docs/guide/3-working-with-detectors.md

-35
Original file line numberDiff line numberDiff line change
@@ -59,38 +59,3 @@ detectors = gl.list_detectors()
5959
detectors = gl.list_detectors(page=1, page_size=5)
6060
# highlight-end
6161
```
62-
63-
### [BETA] Create a Counting Detector
64-
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.
65-
66-
:::note
67-
68-
Counting Detectors are available on [Pro, Business, and Enterprise plans](https://www.groundlight.ai/pricing).
69-
70-
:::
71-
72-
```python notest
73-
from groundlight import ExperimentalApi
74-
75-
gl_experimental = ExperimentalApi()
76-
77-
# highlight-start
78-
detector = gl_experimental.create_counting_detector(name="your_detector_name", query="How many cars are in the parking lot?", max_count=20)
79-
# highlight-end
80-
```
81-
82-
### [BETA] Create a Multi-Class Detector
83-
If you want to classify images into multiple categories, you can create a multi-class detector.
84-
85-
```python notest
86-
from groundlight import ExperimentalApi
87-
88-
gl_experimental = ExperimentalApi()
89-
90-
# highlight-start
91-
class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd"]
92-
detector = gl_experimental.create_multiclass_detector(
93-
name, query="What kind of dog is this?", class_names=class_names
94-
)
95-
# highlight-end
96-
```

docs/docs/guide/5-detector-modalities.md

+12-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Groundlight supports a variety of answer modalities. Thus far, all of the exampl
66

77
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.
88

9-
```python notest
9+
```python
1010
from groundlight import ExperimentalApi
1111
gl_exp = ExperimentalApi()
1212

@@ -36,8 +36,10 @@ Now that you have created a counting detector, you can submit an image query to
3636
from groundlight import ExperimentalApi
3737
gl_exp = ExperimentalApi()
3838

39+
detector = gl_exp.get_detector_by_name("car-counter")
40+
3941
# highlight-start
40-
# Use the detector from the previous example to count the number of cars in an image
42+
# Count the number of cars in an image
4143
image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg")
4244
# highlight-end
4345

@@ -102,7 +104,7 @@ from groundlight import ExperimentalApi
102104
gl_exp = ExperimentalApi()
103105

104106
# highlight-start
105-
# Add a count label with corresponding ROIs to an image query
107+
# Add a count label with corresponding ROIs to the image query from the previous example
106108
roi1 = gl_exp.create_roi("car", (0.1, 0.2), (0.2, 0.3))
107109
roi2 = gl_exp.create_roi("car", (0.4, 0.4), (0.5, 0.6))
108110
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)
115117

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

118-
```python notest
120+
```python
119121
from groundlight import ExperimentalApi
120122
gl_exp = ExperimentalApi()
121123

122124
# highlight-start
123125
class_names = ["Golden Retriever", "Labrador Retriever", "German Shepherd", "Other"]
124126
detector = gl_exp.create_multiclass_detector(
125-
name, query="What kind of dog is this?",
127+
name="dog-breed-detector",
128+
query="What kind of dog is this?",
126129
class_names=class_names,
127130
)
128131
# highlight-end
@@ -140,8 +143,10 @@ Now that you have created a multi-class detector, you can submit an image query
140143
from groundlight import ExperimentalApi
141144
gl_exp = ExperimentalApi()
142145

146+
detector = gl_exp.get_detector_by_name("dog-breed-detector")
147+
143148
# highlight-start
144-
# Use the detector from the previous example to classify the breed of a dog in an image
149+
# Classify the breed of a dog in an image
145150
image_query = gl_exp.submit_image_query(detector, "path/to/image.jpg")
146151
# highlight-end
147152

@@ -160,7 +165,7 @@ from groundlight import ExperimentalApi
160165
gl_exp = ExperimentalApi()
161166

162167
# highlight-start
163-
# Add a multi-class label to an image query
168+
# Add a multi-class label to the image query from the previous example
164169
gl_exp.add_label(image_query, label="German Shepherd")
165170
# highlight-end
166171
```

0 commit comments

Comments
 (0)