def test_label_studio_predictions_visualization():
    """Test creation of LabelStudioImageClassificationInput and Datamodule from images."""
    download_data("https://label-studio-testdata.s3.us-east-2.amazonaws.com/lightning-flash/data.zip")

    datamodule = ImageClassificationData.from_labelstudio(
        train_export_json="data/project.json",
        train_data_folder="data/upload/",
        test_export_json="data/project.json",
        test_data_folder="data/upload/",
        val_split=0.5,
        batch_size=1,
    )
    assert datamodule
    app = launch_app(datamodule)
    predictions = [[0, 1], [1, 0]]
    vis_predictions = app.show_predictions(predictions)
    assert len(vis_predictions) == 4
    assert vis_predictions[0]["result"][0]["id"] != vis_predictions[3]["result"][0]["id"]
    assert vis_predictions[1]["result"][0]["id"] != vis_predictions[2]["result"][0]["id"]
    tasks_predictions = app.show_tasks(predictions)
    assert len(tasks_predictions) == 4
    tasks_predictions_json = app.show_tasks(predictions, export_json="data/project.json")
    assert tasks_predictions_json
Test creation of LabelStudioImageClassificationInput and Datamodule from images.
tests/core/integrations/labelstudio/test_labelstudio.py