HumanSignal / HumanSignal/label-studio

JSON_MIN export contains bounding boxes in transcriptions field

Open
#4,504 2 comments 0 reactions 1 assignee Assigned to @csanadpoda View on GitHub
community:needs-information community:reviewed
Dominant language
TypeScript
Stars
28.3k
Forks
3.7k
Avg merge
14h
Merged PRs (30d)
15

Description

When exporting labels in the JSON_MIN format, sometimes bounding box information is added to the transcriptions instead of the transcriptions themselves.

To Reproduce
Steps to reproduce the behavior:
1. Go to LabelStudio
2. Label a bunch of documents
3. Go back to the project view
4. Click Export
5. Choose JSON_MIN
6. Exported json sometimes has bounding boxes instead of transcriptions in them like this:

```
{
"ocr": "\/data\/upload\/1\/filename.jpg",
"id": 22,
"bbox": [
{
"x": 12.924394307721723,
"y": 8.806096528365792,
"width": 17.47186637895714,
"height": 2.0321761219305667,
"rotation": 0,
"rectanglelabels": [
"Field 1"
],
"original_width": 2480,
"original_height": 3505
},
{
"x": 3.561753840591374,
"y": 64.35224386113462,
"width": 3.3507688945945233,
"height": 1.3547840812870442,
"rotation": 0,
"rectanglelabels": [
"Field 2"
],
"original_width": 2480,
"original_height": 3505
}
],
"transcription": [
"transcribed text 1\n\f", <------THIS IS CORRECTLY TRANSCRIBED TEXT!
{ <------THIS SHOULD BE ANOTHER TEXT, NOT A BBOX!
"x": 13.469188995051033,
"y": 54.451746318841145,
"width": 7.898240965829942,
"height": 1.5241320914479173,
"rotation": 0,
"text": [],
"original_width": 2480,
"original_height": 3505
}
],
"annotator": 4,
"annotation_id": 21,
"created_at": "2023-07-04T12:26:00.911143Z",
"updated_at": "2023-07-05T13:00:04.917034Z",
"lead_time": 1663.167
}
```

**Expected behavior**
I'd expect JSON_MIN to have the following format:
```
{
"ocr": "\/data\/upload\/1\/filename.jpg",
"id": 22,
"bbox": [
{
"x": 12.924394307721723,
"y": 8.806096528365792,
"width": 17.47186637895714,
"height": 2.0321761219305667,
"rotation": 0,
"rectanglelabels": [
"Field 1"
],
"original_width": 2480,
"original_height": 3505
},
{
"x": 3.561753840591374,
"y": 64.35224386113462,
"width": 3.3507688945945233,
"height": 1.3547840812870442,
"rotation": 0,
"rectanglelabels": [
"Field 2"
],
"original_width": 2480,
"original_height": 3505
}
],
"transcription": [
"transcribed text 1\n\f",
"transcribed text 2\n\f"
],
"annotator": 4,
"annotation_id": 21,
"created_at": "2023-07-04T12:26:00.911143Z",
"updated_at": "2023-07-05T13:00:04.917034Z",
"lead_time": 1663.167
}

```
**Environment (please complete the following information):**
- OS: Ubuntu 20.04
- Label Studio Version: 1.8.0

**Additional context**
I wonder if this is user error, or what may cause it, as it's impacting my data transformation scripts. I'm not expecting bbox information among my transcriptions. Also, it seems like the bboxes mostly happen when there's no actual transcription added, just empty text. But empty text is also important information in my use case.

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.