HumanSignal / HumanSignal/label-studio

`OcrLabels` tag seems to be broken for importing tasks with predictions (validation is failing)

Open
#9,139 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

**Describe the bug**
Importing predicted data into Label Studio with the OcrLabels tag (formated with the attributes example data export)
fails with an error:

Prediction validation failed (1 errors): - Task O, prediction O: Region O: Invalid value for control 'quotes'. Got: (x': 0.0, 'y': 0.0, width': 1.0, 'height': 1.0, 'ocrtext': 'some text', 'rotation': O, 'ocrlabels: ['Quote'], 'pagelndex:
1}. Valid options: ['Quote']

**To Reproduce**
Steps to reproduce the behavior:
1. Setup the following labeling UI





2. Import the following prediction

```json
[
{
"data": {
"quote_pdf": "/static/samples/opossum-cuteness.pdf"
},
"predictions": [
{
"result": [
{
"id": "0_0",
"type": "ocrlabels",
"value": {
"x": 0.0,
"y": 0.0,
"width": 1.0,
"height": 1.0,
"ocrtext": "some text",
"rotation": 0,
"ocrlabels": [
"Quote"
],
"pageIndex": 1
},
"origin": "manual",
"to_name": "quote_pdf",
"from_name": "quotes"
}
],
"model_version": "0.1"
}
]
}
]
```

**Expected behavior**

A task should be uploaded with the proper prediction.

---

**Environment (please complete the following information):**
- Labelstudio SaS
- Label Studio Version [v2.33.0.dev9](https://app.humansignal.eu/version)

**Additional context**
The error message implicates that

```json
[
{
"data": {
"quote_pdf": "/static/samples/opossum-cuteness.pdf"
},
"predictions": [
{
"result": [
{
"id": "0_0",
"type": "ocrlabels",
"value": [
"Quote"
],
"origin": "manual",
"to_name": "quote_pdf",
"from_name": "quotes"
}
],
"model_version": "0.1"
}
]
}
]
````

could be a valid import. However, this fails too.

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.