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
In practice, you may want to check for a new result on your query. For example, after a cloud reviewer labels your query. For example, you can use the `image_query.id` after the above `submit_image_query()` call.
Groundlight lets you start using models by making queries against your very first image, but there are a few situations where you might either have an existing dataset, or you'd like to handle the escalation response programatically in your own code but still include the label to get better responses in the future. With your `image_query` from either `submit_image_query()` or `get_image_query()` you can add the label directly. Note that if the query is already in the escalation queue due to low ML confidence or audit thresholds, it may also receive labels from another source.
57
81
58
82
```python
59
-
add_label(image_query, 'YES'). # or 'NO'
83
+
from groundlight import Groundlight
84
+
fromPILimport Image
85
+
import requests
86
+
87
+
gl = Groundlight()
88
+
d = gl.get_or_create_detector(name="doorway", query="Is the doorway open?")
@@ -27,33 +32,32 @@ _Note: The SDK is currently in "beta" phase. Interfaces are subject to change in
27
32
pip3 install groundlight
28
33
```
29
34
30
-
1. To access the API, you need an API token. You can create one on the
31
-
[groundlight web app](https://app.groundlight.ai/reef/my-account/api-tokens). The API token
32
-
should be stored securely. You can use it directly in your code to initialize the SDK like:
33
-
34
-
```python
35
-
gl = Groundlight(api_token="<YOUR_API_TOKEN>")
36
-
```
37
-
38
-
This is an easy way to get started, but is NOT a best practice. Please do not commit your API Token to version control! Instead we recommend setting the `GROUNDLIGHT_API_TOKEN` environment variable outside your code so that the SDK can find it automatically.
35
+
1. Head over to the [groundlight web
36
+
app](https://app.groundlight.ai/reef/my-account/api-tokens) to create an API token. You will
37
+
need to set the `GROUNDLIGHT_API_TOKEN` environment variable to access the API.
@@ -22,12 +37,12 @@ Higher confidence will get higher accuracy, but will generally require longer la
22
37
23
38
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