HumanSignal / HumanSignal/label-studio

What is the correct response format from ML Backend for Label Studio prediction retrieval?

Open
#7,630 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

Hey all,

I'm struggling with the ML Backend response format for Label Studio when retrieving predictions. The error log says:

```
[ml.models::_get_predictions_from_ml_backend::300] [ERROR] ML backend returns an incorrect response, it must be a dict: [...]

```
But my current response looks like this (simplified):

```
[
{
"data": {
"image": "/data/upload/3/714c19ea-28.1905dabf-tile_15_9.png"
},
"predictions": [
{
"model_version": "1.0.0",
"score": 0.85,
"results": [
{
"id": "some-uuid",
"from_name": "label",
"to_name": "image",
"type": "RectangleLabels",
"original_width": 640,
"original_height": 640,
"image_rotation": 0,
"value": {
"x": 93.76,
"y": 157.78,
"width": 108.04,
"height": 76.01,
"rotation": 0,
"score": 0.96,
"RectangleLabels": ["banana"]
}
}
// more results here
]
}
]
}
]
```

The error specifically says:

`ML backend returns an incorrect response, it must be a dict
`

But my response is a list containing a dict.

So:

- What is the exact response format expected by Label Studio's ML Backend API for predictions?
- Should it be a dict instead of a list?
- Any example of a minimal valid response JSON?

I'm pretty sure my current response structure is off, but the docs are vague or confusing. Would really appreciate a clear example or pointer to the official spec.

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.