Predictions

List predictions

GET

Get a list of all predictions. You can optionally filter these by task or by project. If you want to filter, you will need the project ID and/or task ID. Both of these can be found in the Label Studio URL when viewing a task, or you can use List all projects and Get tasks list.

The terms “predictions” and pre-annotations” are used interchangeably.

Predictions can be imported directly into Label Studio or generated by a connected ML backend.

To import predictions via the API, see Create prediction.

Query parameters

taskintegerOptional
Filter predictions by task ID
projectintegerOptional
Filter predictions by project ID

Response

This endpoint returns a list of objects
result
list of maps from strings to any
List of prediction results for the task
task
integer
id
integerOptional
model_version
stringOptional
Model version - tag for predictions that can be used to filter tasks in Data Manager, as well as select specific model version for showing preannotations in the labeling interface
created_ago
stringOptionalDefaults to
Delta time from creation time
score
doubleOptional
Prediction score
cluster
integerOptional
Cluster for the current prediction
neighbors
map from strings to anyOptional
Array of task IDs of the closest neighbors
mislabeling
doubleOptional
Related task mislabeling score
created_at
datetimeOptional
updated_at
datetimeOptional
model
integerOptional
An ML Backend instance that created the prediction.
model_run
integerOptional
A run of a ModelVersion that created the prediction.
project
integerOptional
GET
1curl http://localhost:8080/api/predictions/ \
2 -H "Authorization: Token <api_key>"
200Retrieved
1[
2 {
3 "result": [
4 {
5 "original_width": 1920,
6 "original_height": 1080,
7 "image_rotation": 0,
8 "from_name": "bboxes",
9 "to_name": "image",
10 "type": "rectanglelabels",
11 "value": {
12 "x": 20,
13 "y": 30,
14 "width": 50,
15 "height": 60,
16 "rotation": 0,
17 "values": {
18 "rectanglelabels": {
19 "0": "Person"
20 }
21 }
22 }
23 }
24 ],
25 "task": 1,
26 "id": 1,
27 "model_version": "yolo-v8",
28 "created_ago": "created_ago",
29 "score": 0.95,
30 "cluster": 1,
31 "neighbors": {
32 "neighbors": {
33 "key": "value"
34 }
35 },
36 "mislabeling": 1.1,
37 "created_at": "2024-01-15T09:30:00Z",
38 "updated_at": "2024-01-15T09:30:00Z",
39 "model": 1,
40 "model_run": 1,
41 "project": 1
42 }
43]