For a project I am working on I want to use Label Studio for labeling multi-page pdf documents. To achieve this, I am converting each page of the pdf to an image. Pre-annotating is done locally and I want to import the Task in JSON format into Label Studio to adjust the pre-annotated pages. My Labeling Interface looks like
<View>
<Repeater on="$document" indexFlag="{{idx}}">
<Header value="Page: {{idx}}"></Header>
<Image name="page_{{idx}}" value="$document[{{idx}}].page" inline="true" zoom="true" zoomControl="true" rotateControl="false"/>
<RectangleLabels name="labels_{{idx}}" toName="page_{{idx}}">
<Label value="Table" background="#fffb00"/>
</RectangleLabels>
</Repeater>
</View>
and an example of a Task JSON I have is:
[
{
"document": [
{
"page": "data/local-files?d=images/test_page.pdf-0.jpg"
}
],
"predictions": [
{
"result": [
{
"original_width": 596,
"original_height": 842,
"image_rotation": 0,
"value": {
"x": 10.714892452731128,
"y": 25.596285206121955,
"width": 82.16993093476225,
"height": 23.269432230969787,
"rotation": 0,
"rectanglelabels": [
"Table"
]
},
"id": "0-0",
"from_name": "labels_0",
"to_name": "page_0",
"type": "rectanglelabels"
},
{
"original_width": 596,
"original_height": 842,
"image_rotation": 0,
"value": {
"x": 10.714892452731128,
"y": 62.237614067603175,
"width": 82.16413730131939,
"height": 10.457083731535779,
"rotation": 0,
"rectanglelabels": [
"Table"
]
},
"id": "0-1",
"from_name": "labels_0",
"to_name": "page_0",
"type": "rectanglelabels"
}
]
}
]
}
]
I am using local storage as one can see in the Task JSON. Before trying the multi-page approach, I already tried to have one separate labeling task per page. This worked fine, however, it would be more convenient to have one task per file instead of per page. The problem with my current multi-page approach is that it does not show the predictions (or pre-annotations) in Label Studio. My question is if anyone has any idea on how to solve this? Thanks!