You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* User guide tweak to show how to send in a JPEG image
* Client-side polling
* Updating userguide
Co-authored-by: Auto-format Bot <runner@fv-az353-195.tkyx2seitsuu3nmpmouz2httfb.bx.internal.cloudapp.net>
Co-authored-by: positavi <[email protected]>
Copy file name to clipboardExpand all lines: UserGuide.md
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,23 +2,49 @@
2
2
3
3
Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
4
4
5
+
## Computer vision made simple
6
+
7
+
How to build a working computer vision system in just 5 lines of python code:
8
+
9
+
```Python
10
+
from groundlight import Groundlight
11
+
gl = Groundlight()
12
+
d = gl.create_detector("door", query="Is the door open?") # define with natural language
13
+
image_query = gl.submit_image_query(detector=d, image=jpeg_img) # send in an image
14
+
print(f"The answer is {image_query.result}") # get the result
15
+
```
16
+
5
17
**How does it work?** Your images are first analyzed by machine learning (ML) models which are automatically trained on your data. If those models have high enough confidence, that's your answer. But if the models are unsure, then the images are progressively escalated to more resource-intensive analysis methods up to real-time human review. So what you get is a computer vision system that starts working right away without even needing to first gather and label a dataset. At first it will operate with high latency, because people need to review the image queries. But over time, the ML systems will learn and improve so queries come back faster with higher confidence.
6
18
7
19
*Note: The SDK is currently in "beta" phase. Interfaces are subject to change in future versions.*
8
20
9
21
10
-
## Simple Example
22
+
## Managing confidence levels and latency
11
23
12
-
How to build a computer vision system in 5 lines of python code:
24
+
Groundlight gives you a simple way to control the trade-off of latency against accuracy. The longer you can wait for an answer to your image query, the better accuracy you can get. In particular, if the ML models are unsure of the best response, they will escalate the image query to more intensive analysis with more complex models and real-time human monitors as needed. Your code can easily wait for this delayed response. Either way, these new results are automatically trained into your models so your next queries will get better results faster.
25
+
26
+
The desired confidence level is set as the escalation threshold on your detector. This determines what is the minimum confidence score for the ML system to provide before the image query is escalated.
27
+
28
+
For example, say you want to set your desired confidence level to 0.95, but that you're willing to wait up to 60 seconds to get a confident response.
13
29
14
30
```Python
15
-
from groundlight import Groundlight
16
-
gl = Groundlight()
17
-
d = gl.create_detector("door", query="Is the door open?") # define with natural language
18
-
image_query = gl.submit_image_query(detector=d, image="path/filename.jpeg") # send an image
19
-
print(f"The answer is {image_query.result}") # get the result
31
+
d = gl.create_detector("trash", query="Is the trash can full?", confidence=0.95)
# This will wait until either 30 seconds have passed or the confidence reaches 0.95
34
+
print(f"The answer is {image_query.result}")
20
35
```
21
36
37
+
Or if you want to run as fast as possible, set `wait=0`. This way you will only get the ML results, without waiting for escalation. Image queries which are below the desired confidence level still be escalated for further analysis, and the results are incorporated as training data to improve your ML model, but your code will not wait for that to happen.
0 commit comments