Skip to main content

Getting Started

Computer Vision powered by Natural Language

Build a working computer vision system in just a few lines of python:

from groundlight import Groundlight

gl = Groundlight()
det = gl.get_or_create_detector(name="doorway", query="Is the doorway open?")
img = "./docs/static/img/doorway.jpg" # Image can be a file or a Python object
image_query = gl.submit_image_query(detector=det, image=img)
print(f"The answer is {image_query.result}")

Note: The SDK is currently in "beta" phase. Interfaces are subject to change in future versions. We will follow semver semantics for breaking changes.

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.

Escalation Technology

Groundlight's Escalation Technology combines the power of generative AI using our Visual LLM, along with the speed of edge computing, and the reliability of real-time human oversight.

diagram showing escalation technology

Building a simple visual application

  1. Install the groundlight SDK. Requires python version 3.7 or higher. See prerequisites.

    pip3 install groundlight
  2. Head over to the groundlight web app to create an API token. You will need to set the GROUNDLIGHT_API_TOKEN environment variable to access the API.

    export GROUNDLIGHT_API_TOKEN=api_2GdXMflhJi6L_example
  3. Create a python script.

    ask.py
    from groundlight import Groundlight

    gl = Groundlight()
    det = gl.get_or_create_detector(name="doorway", query="Is the doorway open?")
    img = "./docs/static/img/doorway.jpg" # Image can be a file or a Python object
    image_query = gl.submit_image_query(detector=det, image=img)
    print(f"The answer is {image_query.result}")
  4. Run it!

    python ask.py