Links

Inference API

The Roboflow Inference API is an HTTP Roboflow API used for running inference with models trained on or uploaded to Roboflow.
The Roboflow Inference API is an HTTP Roboflow API used for running inference with models trained on or uploaded to Roboflow.
Using the inference server, you can run inference on object detection, classification, and segmentation models. You can also run inference on "Core Models", useful foundation models you may use in a project. The following core models are supported:
  • CLIP
  • Segment Anything Model (SAM)
Note, not all routes are available in all deployment environments. To see a tailored list of routes for a specific inference endpoint, hit the /docs route of any running inference endpoint.

Installation

CPU Installation

To install the inference server on a CPU, use the following command:
docker run -it –rm –network=host roboflow/roboflow-inference-server-cpu

GPU Installation (TRT Container)

To install the inference server on a GPU using the TRT container, use the following command:
docker run -it –rm –network=host –gpus=all roboflow/roboflow-inference-server-trt

Use the Infer Server with the Roboflow Python Package

Once you have the inference server installed, review the Inference API Schema to see the requests you can make to the server.
You can route requests via the Python package through your inference container using the following code:
local_inference_server_address = "http://localhost:9001/"
version_number = 1
local_model = project.version(
version_number=version_number,
local=local_inference_server_address
).model

Routes

Version 0.6.0
get
/
Root
post
/infer/object_detection
Object detection infer
post
/infer/instance_segmentation
Instance segmentation infer
post
/infer/classification
Classification infer
post
/clip/embed_image
CLIP Image Embeddings
post
/clip/embed_text
CLIP Text Embeddings
post
/clip/compare
CLIP Compare
post
/sam/embed_image
SAM Image Embeddings
post
/sam/segment_image
SAM Image Segmentation
post
/{dataset_id}/{version_id}
Legacy Infer
For some routes, a Roboflow API Key can be provided as a query parameter, or as part of the request payload. For Roboflow model endpoints (e.g. detect.roboflow.com), an API Key must be provided as a query parameter.
Last modified 2mo ago