Custom Metadata

You can attach a custom metadata value to each inference result and view it in the Model Monitoring dashboard

Create custom metadata

POST /:workspace/inference-stats/metadata

Attaches additional data to an inference result to be displayed in the Model Monitoring dashboard.

When you make an inference request with Roboflow's Inference Container or Hosted Inference API, you will receive an inference_id in the response. Using this id, you can add it to the "inference_ids" array as shown below to attach your metadata to it. The "field_name" is a name for the property, and the value is the value.

For example, if I want to attach a geographic location to my inference results, I would set the field_name to "location" and the value would be a location like "usa" or "canda".

Note: The values for field_name and field_value are completely user-defined. Be sure to keep it consistently formatted the same, otherwise, it will be treated as a separate field in the model monitoring dashboard. For example field_name: "my_location" and field_name: "My_location" will be treated as two separate metadata values.

Example Request

curl --location --request POST 'https://api.roboflow.com/${WORKSPACE}/inference-stats/metadata' \
--header 'Content-Type: application/json' \
--data-raw '{
    "api_key": "<your_api_key>",
    "data": [
        {
            "inference_ids": ["a12a19a9-a933-44c9-970c-a55ea03bb453"],
            "field_name": "camera_location",
            "field_value": "canada"
        },
        {
            "inference_ids": ["accf0af9-bdf0-4b22-8106-6988d4cada5a"],
            "field_name": "camera_location",
            "field_value": "emea"
        }
    ]
}'

Headers

NameValue

Content-Type

application/json

Body

NameTypeDescription

data

Array<Metadata>

{

"inference_ids": Array<string>;

"field_name": string;

"field_value": string;

}

Response

{
  "status": "ok"
}

Last updated