Label Studio

With Lightly, you can export selected images effortlessly to the Label Studio format.

import json
from lightly.api.api_workflow_client import ApiWorkflowClient

# Create the Lightly client to connect to the API.
client = ApiWorkflowClient(token="MY_LIGHTLY_TOKEN", dataset_id="MY_DATASET_ID")

label_studio_tasks = client.export_label_studio_tasks_by_tag_name(
    "initial-tag"  # name of the tag in the dataset
)
with open("label_studio_tasks.json", "w") as f:
    json.dump(label_studio_tasks, f, indent=4)

The resulting file should look similar to this:

[
	{
      "data": {
        "image": "https://api.lightly.ai/your-image-url.png",
        "lightlyFileName": "your-image-url.png",
        "lightlyMetaInfo" : {} // contains meta information stored within the Lightly Platform
      },
      "id": 0
	},
	...
]

Now, you can import the Label Studio tasks and start labeling your data.