Object detection (original) (raw)

Object Detection models allow users to identify objects of certain defined classes. These models receive an image as input and output the images with bounding boxes and labels on detected objects.

For more details about the object-detection task, check out its dedicated page! You will find examples and related materials.

Explore all available models and find the one that suits you best here.

Using the API

There are currently no snippet examples for the object-detection task, as no providers support it yet.

API specification

Request

Headers
authorization string Authentication header in the form 'Bearer: hf_****' when hf_**** is a personal user access token with “Inference Providers” permission. You can generate one from your settings page.
Payload
inputs* string The input image data as a base64-encoded string. If no parameters are provided, you can also provide the image data as a raw bytes payload.
parameters object
threshold number The probability necessary to make a prediction.

Response

Body
(array) object[] Output is an array of objects.
label string The predicted label for the bounding box.
score number The associated score / probability.
box object
xmin integer The x-coordinate of the top-left corner of the bounding box.
xmax integer The x-coordinate of the bottom-right corner of the bounding box.
ymin integer The y-coordinate of the top-left corner of the bounding box.
ymax integer The y-coordinate of the bottom-right corner of the bounding box.

< > Update on GitHub