Troubleshooting image loading issue in Label Studio with local storage paths

Question:

I’ve set LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true and LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=C:\User\YOLO\dataset\ to the environment. However, after converting my YOLO dataset with the Label Studio Converter to get a JSON with image paths, I can’t display the images in Label Studio—there’s an error loading the image URL.

Answer:

Ensure the environment variables are set properly before starting Label Studio. Use the following command to set them:

set LABEL_STUDIO_LOCAL_FILES_SERVING_ENABLED=true
set LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT=C:\User\YOLO\dataset\
label-studio start

Modify your JSON to have correct relative paths based on your LABEL_STUDIO_LOCAL_FILES_DOCUMENT_ROOT. Your JSON paths should look like this:

[
  {
    "data": {
      "image": "/data/local-files/?d=train/images/004811b6-Cam_3340.jpg"
    },
    ...
  }
]

Re-import this amended JSON into Label Studio.

Go to Label Studio Settings > Cloud Storage, add new local storage with the “Local path” field set to C:\User\YOLO\dataset\train\images. Don’t sync storage, just let Label Studio know where images are located.

Try these steps and verify that the images load correctly. Make sure the image paths are accessible and that the environment variables are set in the session running Label Studio.

I was trying to connect mmdetection-3 model from examples with docker and I got the following error
{“detail”:“InvalidSchema: No connection adapters were found for \”'http://127.0.0.1:8080/'/data/upload/4/be70c9c8-cat_and_dog_1.jpg\“”,“request”:{},“result”:{“traceback”:“Traceback (most recent call last):\n File \”/opt/conda/lib/python3.9/site-packages/label_studio_ml/exceptions.py\"