Announcing Paginated Multi-Image Labeling
This walkthrough explains how to use Label Studio’s paginated multi-image labeling feature to annotate PDFs by stacking images within a single task. It covers data preparation, project setup, labeling configuration, and how to manage page-level annotations.
Transcript
We’re excited to announce that Label Studio now supports paginated multi-image labeling. This functionality lets you stack multiple images in a single task, making labeling easier than ever before.
In this video, we’ll demonstrate how paginated multi-image labeling unlocks basic PDF support.
The first thing we’ll need to do is convert our PDF into a series of images. You can do this with built-in tools like Adobe Acrobat Pro or Preview on Mac, but we’ll use a Python package called pdf2image to do it programmatically. This package is a wrapper around Poppler, so you’ll need to install that as well. More instructions can be found on the pdf2image GitHub page.
We’ve included a sample script in our Label Studio examples repository so you can access it quickly. The script assumes you have a folder of PDFs. In our example, it’s a subfolder called “pdfs.” The script goes through that folder, converts each PDF to images, and creates a list of URLs to access the images using a base host path.
We recommend hosting these images in the cloud using our external storage feature, but you can also configure local storage if needed. The script outputs the JPEG images and a data.json file that you can import directly into Label Studio. If you don’t have global read permissions enabled on your storage, you’ll need to follow the instructions for linking your cloud storage instead of uploading manually.
Now that our data is ready, we can create a project in Label Studio. Click the “Create Project” button and give it a name. In the data import step, upload the JSON file we just created.
For the labeling config, we’ll use the multi-page document annotation setup. The config uses the rectangle labels tag to create bounding boxes and the image tag to display images. You’ll also see a valueList parameter, which is what enables multipage annotation.
When we click into a sample, we can see the document loads as a series of stacked images. In our example, we’ll draw bounding boxes around different sections of the document. These work the same way as in any other use case. Click on the label you want to use, draw the bounding box, and click submit when you're done.
We can also add classification to this task. To do that, we’ll add the choices tag below the image. We’ll fix the spacing a bit for readability. The choices tag looks familiar, but now includes a perItem equals true field. This allows us to classify each page separately, instead of labeling the document as a whole.
Once we save this, we can go back to the task. We’ll make bounding boxes like before, and now we’ll see radio buttons at the bottom of each page. For example, if a page doesn’t contain an image, we’ll select that option. When we move to the next page, the buttons reset so we can label that page separately.
To view the output of our annotations, click the “Show Task Source” button in the Data Manager. Scroll to the annotations section, and you’ll see a new item_index field. This tells you which page of the document each annotation belongs to. It’s zero-indexed, so page one is item index zero.
And that’s it. With paginated multi-image labeling, you can now annotate documents like PDFs or other multi-image sets with ease.
Happy labeling.