Welcome! This is a small "Hello World" example for Groundlight. Please clone this repo, and this readme will walk you through how to get your first Groundlight application up and running!
This example application uses Groundlight to answer the question: "Is the door open?". The application takes a picture from a camera connected to your computer every 10 seconds, and sends it to Groundlight for processing.
- Create a free Groundlight account at https://app.groundlight.ai/.
- Create an API token by clicking on your account name in the top right corner, and then clicking on "API Tokens". Alternatively, you can click here to go to the page directly.
- Paste your API token into the
GROUNDLIGHT_API_TOKEN
variable in the.env
file (make sure you do not check this file into version control, as it contains your secret API token). - Ensure your computer has a camera, either a built in webcam or a USB camera. The application will automatically detect your camera. If you are on a Mac, the application might detect your iPhone as your primary webcam. See the notes in
setup.py
for how to change this to your built in webcam, if desired. - Install python dependencies by running
pip install -r requirements.txt
. - Aim your camera at a door.
- Run
python main.py
to start the application. - Test out the application by opening and closing the door. You should see the application print out whether the door is open or closed every 10 seconds.
- Explore your results in more depth in the Groundlight web app!
- Read over the code in
main.py
and try modifying the query to solve a different problem. It's as simple as changing thequery_text
anddetector_name
variables. - Read our guide to Getting Started with Groundlight here.
- Read our SDK documentation here.
- Ask us questions! We would love to help you get started. See here for how to contact us.
If you have a Raspberry Pi with a camera, you can deploy this application on your Raspberry Pi. This is a great way to get started with Groundlight, as you can deploy your application in a low cost, low power environment.
- Flash your Raspberry Pi with the latest version of our Raspberry Pi Image. You can find instructions here.
- Clone this repo on your Raspberry Pi (
git clone [email protected]:groundlight/getting_started.git
) - Follow the instructions above, in the Your First Groundlight Application section.
If you have any questions, please reach out to us by filing a GitHub issue, emailing us at [email protected] or by messaging us via the chat widget in the bottom right hand corner of the Groundlight web app.