YOLOLite

Use the YOLOlite model family through our Serverless Hosted API

YOLOlite is a lightweight object detection model family from Roboflow, designed for low-latency deployments and edge hardware. You can train YOLOlite on a Project in Roboflow and deploy it via our Serverless Hosted API.

For self-hosted deployment, see Roboflow Inference.

YOLOlite input size is configured during training on Roboflow.

Available variants

YOLOlite ships in two scaling families: a standard set and an edge-optimized set. Each is available in five sizes.

Family
Variants

Standard

yololite-n, yololite-s, yololite-m, yololite-l, yololite-xl

Edge

yololite-edge-n, yololite-edge-s, yololite-edge-m, yololite-edge-l, yololite-edge-xl

You select a variant when training a YOLOlite model on a Project. The trained model is then served from the Serverless Hosted API under your workspace/project/version path.

Code sample

Install the Inference SDK and supervision:

pip install inference-sdk supervision

The following sample runs detection against a YOLOlite model trained on a Roboflow Project, decodes the response with supervision, draws boxes and labels, and saves the annotated PNG. Replace your-project/1 with your own project/version. Pass your Roboflow API Key via the API_KEY environment variable.

import os
import urllib.request

import cv2
import supervision as sv
from inference_sdk import InferenceHTTPClient

image_url = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/cars-highway.png"
image_path = "cars-highway.png"
urllib.request.urlretrieve(image_url, image_path)

image = cv2.imread(image_path)

client = InferenceHTTPClient(
    api_url="https://serverless.roboflow.com",
    api_key=os.getenv("API_KEY"),
)
results = client.infer(image, model_id="your-project/1")

detections = sv.Detections.from_inference(results)

box_annotator = sv.BoxAnnotator()
label_annotator = sv.LabelAnnotator()

annotated = box_annotator.annotate(scene=image.copy(), detections=detections)
annotated = label_annotator.annotate(scene=annotated, detections=detections)

cv2.imwrite("annotated.png", annotated)

Set api_url to match your deployment target:

  • https://serverless.roboflow.com for the Serverless Hosted API.

  • http://localhost:9001 for a local Inference server.

  • Your Dedicated Deployment URL for a private endpoint.

Last updated

Was this helpful?