I'm trying to figure out how to open/import/view a Label Studio yolo export from a different machine on my machine in order to directly view the bounding boxes as they were labeled.

I received a folder with /images, /labels, and classes.txt that was created as a yolo export from someone using label-studio. The labels are for rectangular bounding boxes with rotation. I currently have a python program that runs through each image and annotation to create and save a new image with the bounding box on it, so that I can see how things were labeled. However, I'd really like to be able to open my local Label Studio to view the folder I received from someone who used Label Studio on their own machine.

It seems I'm missing something very basic and obvious. Any help is appreciated.

I reviewed the documentation, including here https://labelstud.io/guide/tasks.html but the imports are for the original source data, not the data + labels. I don't see any mention of importing the labels text files. Google searching is turning up nothing related to importing the exported data. I may not be using the right search terms.

1

There are 1 best solutions below

0
On BEST ANSWER

I was quite surprised this obvious case was not clearly explained in the documentation; asked for help myself and got no answer, so I figured out a solution that worked for me. The explanation is very long, but in practice, it is quite straightforward.

  1. Export annotations as json-mini from the source server
  2. Write a Python script to read JSON and write a simpler JSON with just the bare info (this step is not strictly necessary, but I did it as an intermediate step to keep better control)
  3. Read the bare JSON and use the info to write an import.json file that must have the format suited to import predictions. you can find info on the format here https://labelstud.io/guide/predictions.html. The key trick is that in this import.json you can reference the images with the absolute path of the target server.
  4. Use this latest import.json to import into the target server.
  5. Once images are imported into label-Studio note that they all have a prediction flag, but none have an annotation flag. Therefore you need to select all and from the drop-down copy predictions into annotations.

All the above is longer to explain than to do. The only further point you should remember to make is to enable the use of local files in settings. In Label-Studio go to Settings->Cloud storage->Add Source Storage ->Local files Based on the OS you are using, you might need to set an environment variable to allow for this.

Once everything works, you might just need a single short script to do step 2 and 3 at once. This workaround has the additional benefit of allowing for programmatic changes to the labels. For instance, you might want to change a given label text from 10000 annotated images into a different text (e.g. more specific) with this script you can programmatically do that easily.