Loading repository data…
Loading repository data…
roboflow / repository
Turn any computer or edge device into a command center for your computer vision projects.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
notebooks | supervision | autodistill | maestro
Inference turns any computer or edge device into a command center for your computer vision projects.
See Example Workflows for common use-cases like detecting small objects with SAHI, multi-model consensus, active learning, reading license plates, blurring faces, background removal, and more.
Install Docker (and NVIDIA Container Toolkit for GPU acceleration if you have a CUDA-enabled GPU). Then run
pip install inference-cli && inference server start --dev
This will pull the proper image for your machine and start it in development mode.
In development mode, a Jupyter notebook server with a quickstart guide runs on http://localhost:9001/notebook/start. Dive in there for a whirlwind tour of your new Inference Server's functionality!
Now you're ready to connect your camera streams and start building & deploying Workflows in the UI or interacting with your new server via its API.
A key component of Inference is Workflows, composable blocks of common functionality that give models a common interface to make chaining and experimentation easy.
With Workflows, you can:
Workflows allow you to extend simple model predictions to build computer vision micro-services that fit into a larger application or fully self-contained visual agents that run on a video stream.
Learn more, read the Workflows docs, or start building.
Once you've installed Inference, your machine is a fully-featured CV center.
You can use its API to run models and workflows on images and video streams.
By default, the server is running locally on
localhost:9001.
To interface with your server via Python, use our SDK:
pip install inference-sdk
Then run an example model comparison Workflow like this:
from inference_sdk import InferenceHTTPClient
client = InferenceHTTPClient(
api_url="http://localhost:9001", # use local inference server
# api_key="<YOUR API KEY>" # optional to access your private data and models
)
result = client.run_workflow(
workspace_name="roboflow-docs",
workflow_id="model-comparison",
images={
"image": "https://media.roboflow.com/workflows/examples/bleachers.jpg"
},
parameters={
"model1": "yolov8n-640",
"model2": "yolov11n-640"
}
)
print(result)
In other languages, use the server's REST API;
you can access the API docs for your server at
/docs (OpenAPI format) or
/redoc (Redoc Format).
Check out the inference_sdk docs to see what else you can do with your new server.
The inference server is a video processing beast. You can set it up to run Workflows on RTSP streams, webcam devices, and more. It will handle hardware acceleration, multiprocessing, video decoding and GPU batching to get the most out of your hardware.
This example workflow will watch a stream for frames that CLIP thinks match an inputted text prompt.
from inference_sdk import InferenceHTTPClient
import atexit
import time
max_fps = 4
client = InferenceHTTPClient(
api_url="http://localhost:9001", # use local inference server
# api_key="<YOUR API KEY>" # optional to access your private data and models
)
# Start a stream on an rtsp stream
result = client.start_inference_pipeline_with_workflow(
video_reference=["rtsp://user:password@192.168.0.100:554/"],
workspace_name="roboflow-docs",
workflow_id="clip-frames",
max_fps=max_fps,
workflows_parameters={
"prompt": "blurry", # change to look for something else
"threshold": 0.16
}
)
pipeline_id = result["context"]["pipeline_id"]
# Terminate the pipeline when the script exits
atexit.register(lambda: client.terminate_inference_pipeline(pipeline_id))
while True:
result = client.consume_inference_pipeline_result(pipeline_id=pipeline_id)
if not result["outputs"] or not result["outputs"][0]:
# still initializing
continue
output = result["outputs"][0]
is_match = output.get("is_match")
similarity = round(output.get("similarity")*100, 1)
print(f"Matches prompt? {is_match} (similarity: {similarity}%)")
time.sleep(1/max_fps)
Pipeline outputs can be consumed via API for downstream processing or the Workflow can be configured to call external services with Notification blocks (like Email or Twilio) or the Webhook block. For more info on video pipeline management, see the Video Processing overview.
If you have a Roboflow account & have linked an API key, you can also remotely monitor and manage your running streams via the Roboflow UI.
Without an API Key, you can access a wide range of pre-trained and foundational models and run public Workflows.
Pass an optional Roboflow API Key to the inference_sdk or API to access additional features enhanced by Roboflow's Cloud
platform. When running with an API Key, usage is metered according to
Roboflow's pricing tiers.
| Open Access | With API Key (Metered) | |
|---|---|---|
| Pre-Trained Models | ✅ | ✅ |
| Foundation Models | ✅ | ✅ |
| Video Stream Management | ✅ | ✅ |
| [Dynamic Python Blocks](https:// |