For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run a Model on an Image

You can use the Roboflow CLI to run a model trained on Roboflow, or with open source models available on Roboflow Universe.

By running roboflow infer in the command line, the CLI sends the image to the Roboflow API and prints the predictions.

Command

roboflow infer <image-path> -m <project/version>

Options

Flag
Description

-m, --model

Model ID in project/version format (required)

-c, --confidence

Confidence threshold, 0.0–1.0 (default: 0.5)

-o, --overlap

Overlap/NMS threshold, 0.0–1.0 (default: 0.5)

-t, --type

Model type (skip auto-detection): object-detection, classification, instance-segmentation, semantic-segmentation, keypoint-detection

Examples

Run inference using an open source model from Roboflow Universe - for example, the poker-cards dataset:

roboflow infer ~/Downloads/ace.jpg -m poker-cards-cxcvz/1 -c 0.7

The workspace defaults to your configured workspace. To use a model from a different workspace:

roboflow infer photo.jpg -m poker-cards-cxcvz/1 -w roboflow-100

Specify the model type to skip the auto-detection API call:

roboflow infer photo.jpg -m my-project/3 -t object-detection

JSON Output

Use --json to get structured prediction data for scripting and automation:

See all supported parameters with roboflow infer --help.

Last updated

Was this helpful?