Skip to content

Commit 9d4aefc

Browse files
author
Tyler Romero
committed
more rewritign
1 parent 26dc9c2 commit 9d4aefc

File tree

1 file changed

+75
-47
lines changed

1 file changed

+75
-47
lines changed

β€Ždocs/docs/getting-started/getting-started.mdxβ€Ž

Lines changed: 75 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,70 @@
11
# Getting Started with Groundlight
22

3-
## Build Computer Vision Applications in Minutes with Groundlight's Python SDK
3+
## Build Powerful Computer Vision Applications in Minutes
44

5-
Welcome to Groundlight AI! This guide will help you build your first computer vision application quickly and easily using our Python SDK.
5+
Welcome to Groundlight AI! This guide will help you create your first computer vision application
6+
quickly and easily using our intuitive Python SDK. Whether you're monitoring wildlife,
7+
automating quality control, or building smart security systems, Groundlight makes computer vision
8+
accessible to everyone.
69

7-
Don't code? [Contact our team](mailto:support@groundlight.ai) and we'll build a custom solution for you.
10+
Don't code? No problem! [Contact our team](mailto:support@groundlight.ai) and we'll build a custom solution tailored to your needs.
811

912
### Prerequisites
10-
Before you begin, make sure you have:
11-
1. A [Groundlight account](https://dashboard.groundlight.ai/)!
12-
2. An API token from the [Groundlight dashboard](https://dashboard.groundlight.ai/reef/my-account/api-tokens). See our [guide to API Tokens](http://localhost:3000/python-sdk/docs/getting-started/api-tokens) for more info.
13-
3. Python 3.9 or newer installed
13+
Before diving in, you'll need:
14+
1. A [Groundlight account](https://dashboard.groundlight.ai/) (sign up is quick and easy!)
15+
2. An API token from your [Groundlight dashboard](https://dashboard.groundlight.ai/reef/my-account/api-tokens). Check out our [API Tokens guide](http://localhost:3000/python-sdk/docs/getting-started/api-tokens) for details.
16+
3. Python 3.9 or newer installed on your system.
1417

15-
### Installing the Groundlight SDK
18+
### Setting Up Your Environment
1619

17-
You can install the Groundlight SDK via pip. When installing python packages, it is a best practice to install them
18-
inside of virtual environments. Run the following in the command line to create a new environment:
20+
Let's set up a clean Python environment for your Groundlight project! The Groundlight SDK is available on PyPI and can be installed with [pip](https://packaging.python.org/en/latest/tutorials/installing-packages/#use-pip-for-installing).
21+
22+
First, let's create a virtual environment to keep your Groundlight dependencies isolated from other Python projects:
1923
```bash
2024
python3 -m venv groundlight-env
2125
```
26+
Now, activate your virtual environment:
27+
```bash
28+
# MacOS / Linux
29+
source groundlight-env/bin/activate
30+
```
31+
```
32+
# Windows
33+
.\groundlight-env\Scripts\activate
34+
```
2235

23-
Activate the virtual environment using
24-
- On macOS or Linux, `source groundlight-env/bin/activate`
25-
- On Windows, `.\groundlight-env\Scripts\activate`
26-
27-
Now, you can install the Groundlight SDK using pip:
36+
With your environment ready, install the Groundlight SDK with a simple pip command:
2837
```bash
2938
pip install groundlight
3039
```
3140

32-
For more detailed installation instructions, see the [installation guide](/docs/installation/).
41+
Let's also install [framegrab](https://github.com/groundlight/framegrab) with YouTube support -
42+
this useful library will let us capture frames from YouTube livestreams, webcams, and other video
43+
sources, making it easy to get started!
44+
```bash
45+
pip install framegrab[youtube]
46+
```
47+
:::tip Camera Support
48+
Framegrab is versatile! It works with:
49+
- Webcams and USB cameras
50+
- RTSP streams (security cameras)
51+
- Professional cameras (Basler USB/GigE)
52+
- Depth cameras (Intel RealSense)
53+
- Video files and streams (mp4, mov, mjpeg, avi)
54+
- YouTube livestreams
55+
56+
This makes it perfect for quickly prototyping your computer vision applications!
57+
:::
58+
59+
Need more options? Check out our detailed [installation guide](/docs/installation/) for advanced setup instructions.
3360

3461
### Authentication
35-
The Groundlight SDK uses API tokens to authenticate your requests to the Groundlight API.
36-
When you make API calls, the SDK automatically uses your token to verify your identity and permissions. It
37-
does this by checking the `GROUNDLIGHT_API_TOKEN` environment variable. In order to set this environment
38-
variable, run:
62+
63+
Now let's set up your credentials so you can start making API calls. Groundlight uses API tokens to securely authenticate your requests.
64+
65+
If you don't have an API token yet, refer to our [API Tokens guide](/docs/getting-started/api-tokens) to create one.
66+
67+
The SDK will automatically look for your token in the `GROUNDLIGHT_API_TOKEN` environment variable. Set it up with:
3968
```bash
4069
# MacOS / Linux
4170
export GROUNDLIGHT_API_TOKEN='your-api-token'
@@ -44,7 +73,7 @@ export GROUNDLIGHT_API_TOKEN='your-api-token'
4473
# Windows
4574
setx GROUNDLIGHT_API_TOKEN "your-api-token"
4675
```
47-
:::important
76+
:::important API Tokens
4877
Keep your API token secure! Anyone who has access to it can impersonate you and can access to your Groundlight data.
4978
:::
5079

@@ -55,49 +84,48 @@ visual question you want to answer, while an `ImageQuery` is a request to analyz
5584

5685
The Groundlight system is designed to provide consistent, highly confident answers for similar images
5786
(such as frames from the same camera) when asked the same question repeatedly. This makes it ideal for
58-
monitoring scenarios where you need reliable visual detection.
87+
scenarios where you need reliable visual detection.
5988

6089
Let's see how to use Groundlight to analyze an image:
6190
```python title="ask.py"
62-
from groundlight import Groundlight, Detector, ImageQuery
6391
from framegrab import FrameGrabber
92+
from groundlight import Groundlight, Detector, ImageQuery
6493

6594
gl = Groundlight()
6695
detector: Detector = gl.get_or_create_detector(
6796
name="eagle-detector",
6897
query="Is there an eagle visible?",
6998
)
7099

71-
# Big Bear Bald Eagle Nest live-stream
100+
# Big Bear Bald Eagle Nest livestream
72101
youtube_live_url = 'https://www.youtube.com/watch?v=B4-L2nfGcuE'
73102

74-
config = {
103+
framegrab_config = {
75104
'input_type': 'youtube_live',
76105
'id': {'youtube_url': youtube_live_url},
77106
}
78107

79-
with FrameGrabber.create_grabber({
80-
'input_type': 'youtube_live', 'id': {'youtube_url': youtube_live_url},
81-
}) as grabber:
108+
with FrameGrabber.create_grabber(framegrab_config) as grabber:
82109
frame = grabber.grab()
83110
if frame is None:
84-
raise Exception("No frame captured")
111+
raise RuntimeError("No frame captured")
85112

86-
image_query = gl.submit_image_query(detector=detector, image=frame)
113+
iq: ImageQuery = gl.submit_image_query(detector=detector, image=frame)
87114

88-
print(f"The answer is {image_query.result.label}")
89-
print(image_query)
115+
print(f"{detector.query} -- Answer: {iq.result.label} with confidence={iq.result.confidence:.3f}\n")
116+
print(iq)
90117
```
91118

92119
Run the code using `python ask.py`. The code will submit an image from the live-stream to the Groundlight API and print the result:
93120
```
94-
The answer is YES
121+
Is there an eagle visible? -- Answer: YES with confidence=0.988
122+
95123
ImageQuery(
96124
id='iq_2pL5wwlefaOnFNQx1X6awTOd119',
97125
query="Is there an eagle visible?,
98126
detector_id='det_2owcsT7XCsfFlu7diAKgPKR4BXY',
99127
result=BinaryClassificationResult(
100-
confidence=0.9995857543478209,
128+
confidence=0.9884857543478209,
101129
label=<Label.YES: 'YES'>
102130
),
103131
created_at=datetime.datetime(2025, 2, 25, 11, 5, 57, 38627, tzinfo=tzutc()),
@@ -108,26 +136,26 @@ ImageQuery(
108136
metadata=None
109137
)
110138
```
139+
## What's Next?
111140

112-
For more information on the Groundlight SDK, see the [API Reference](/docs/api-reference/), or check out our [guide to building applications with the Groundlight SDK](/docs/guide/).
141+
πŸŽ‰ **Amazing job!** You've just built your first computer vision application with Groundlight. In just a few lines of code, you've created an eagle detector that can analyze live video streams!
113142

114-
### Using Your Computer Vision Application
143+
### Supercharge Your Application
115144

116-
Congratulations! You now have a fully functional computer vision application. You can easily customize the code and configure detectors for your specific use cases.
145+
Take your application to the next level:
117146

118-
Monitor and enhance your detector's performance through the [Groundlight Dashboard](https://dashboard.groundlight.ai/).
119-
Groundlight's human-in-the-loop technology intelligently monitors your image feed for anomalies and unexpected changes.
120-
By reviewing and verifying results, you continuously improve the system's accuracy. Through the dashboard, you can also
121-
[configure text and email notifications](/docs/guide/alerts) to alert you when important events are detected in your video stream.
147+
- **Monitor in real-time** through the [Groundlight Dashboard](https://dashboard.groundlight.ai/) - see your detections, review results, and track performance
148+
- **Get instant alerts** when important events happen - [set up text and email notifications](/docs/guide/alerts) for critical detections
149+
- **Improve continuously** with Groundlight's human-in-the-loop technology that learns from your feedback
122150

123151
### Next Steps
124152

125-
Now that you've built your first application, you can:
126-
1. Learn how to [write effective queries](/docs/getting-started/writing-queries).
127-
2. Proceed to [capture images from a wide variety of sources](/docs/guide/grabbing-images) using [`framegrab`](https://github.com/groundlight/framegrab).
128-
3. Read our guide to [confidence thresholds](/docs/guide/managing-confidence).
129-
130-
153+
| What You Want To Do | Resource |
154+
|---|---|
155+
| πŸ“ Create better detectors | [Writing effective queries](/docs/getting-started/writing-queries) |
156+
| πŸ“· Connect to cameras, RTSP, or other sources | [Grabbing images from various sources](/docs/guide/grabbing-images) |
157+
| 🎯 Fine-tune detection accuracy | [Managing confidence thresholds](/docs/guide/managing-confidence) |
158+
| πŸ“š Explore the full API | [SDK Reference](/docs/api-reference/) |
131159

132160
Ready to explore more possibilities? Visit our [Guides](https://www.groundlight.ai/guides) to discover sample
133161
applications built with Groundlight AI β€” from [industrial inspection workflows](https://www.groundlight.ai/blog/lkq-corporation-uses-groundlight-ai-to-revolutionize-quality-control-and-inspection)

0 commit comments

Comments
Β (0)