Classification
Run inference on classification models hosted on Roboflow.
Response Object Formats
Single-Label Classification
The hosted API inference route returns a JSON
object containing an array of predictions. Each prediction has the following properties:
time
= total time, in seconds, to process the image and return predictionsimage
= an object that holds information about the imagewidth
andheight
width
the height of the predicted imageheight
= the height of the predicted image
predictions
= collection of all predicted classes and their associated confidence values for the predictionclass
= the label of the classificationconfidence
= the model's confidence that the image contains objects of the detected classification
top
= highest confidence predicted classconfidence
= highest predicted confidence scoreimage_path
= path of the predicted imageprediction_type
= the model type used to perform inference,ClassificationModel
in this case
API Reference
Using the Inference API
POST
https://classify.roboflow.com/:datasetSlug/:versionNumber
You can POST a base64 encoded image directly to your model endpoint. Or you can pass a URL as the image
parameter in the query string if your image is already hosted elsewhere.
Path Parameters
datasetSlug
string
The url-safe version of the dataset name. You can find it in the web UI by looking at the URL on the main project view.
string
The version number identifying the version of your dataset.
Query Parameters
api_key
string
Your API key (obtained via your workspace API settings page)
Last updated