HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
18.39k stars 2.31k forks source link

The label images cannot be displayed on Web #5200

Open zhangyhdgut opened 9 months ago

zhangyhdgut commented 9 months ago

Describe the bug I use the MinIO as the Label Studio Data Storage, and the label images were successfully uploaded using Minio, but they cannot be displayed on the page.

In Label Studio Project Web Page, I found the 'image' filed in task is erro.

image

The MinIO Console information: image

To Reproduce The 'docker-compose.yml':

  app:
    stdin_open: true
    tty: true
    build: .
    image: heartexlabs/label-studio:latest
    restart: unless-stopped
    expose:
      - "8000"
    depends_on:
      - db
    environment:
      - DJANGO_DB=default
      - POSTGRE_NAME=postgres
      - POSTGRE_USER=postgres
      - POSTGRE_PASSWORD=
      - POSTGRE_PORT=5432
      - POSTGRE_HOST=db
      - LABEL_STUDIO_HOST=${LABEL_STUDIO_HOST:-}
      - JSON_LOG=1
      - LOG_LEVEL=DEBUG
      - MINIO_STORAGE_ACCESS_KEY=${MINIO_ROOT_USER:-minio_admin_do_not_use_in_production}
      - MINIO_STORAGE_SECRET_KEY=${MINIO_ROOT_PASSWORD:-minio_admin_do_not_use_in_production}
      - MINIO_STORAGE_BUCKET_NAME=data
      - MINIO_STORAGE_ENDPOINT=http://minio:9000
    volumes:
      - /home/zhouli/docker/labeling_192/mydata:/label-studio/data:rw
    command: label-studio-uwsgi

Expected behavior Successfully displayed on the page.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

hogepodge commented 8 months ago

Can you share your cloud storage configuration screen for Label Studio? We will need to see that to verify that this isn't a misconfiguration on the LS side.

zhangyhdgut commented 8 months ago

First, thanks for your comment. It also has the same problem when I use the local mode. The VSCode launch.json is configured as follows:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: MinIO",
            "type": "python",
            "request": "launch",
            "program": "${workspaceFolder}/label_studio/manage.py",
            "args": [
                "runserver",
                "0.0.0.0:9080"
            ],
            "env": {
                "DJANGO_DB": "default",
                "POSTGRE_NAME": "postgres",
                "POSTGRE_USER": "postgres",
                "POSTGRE_PASSWORD": "",
                "POSTGRE_PORT": "5432",
                "POSTGRE_HOST": "127.0.0.1",
                "JSON_LOG": "1",
                "LOG_LEVEL": "DEBUG",
                "MINIO_STORAGE_ACCESS_KEY": "label_minio",
                "MINIO_STORAGE_SECRET_KEY": "label_minio",
                "MINIO_STORAGE_BUCKET_NAME": "data",
                "MINIO_STORAGE_ENDPOINT": "http://10.0.201.52:9000",
            },
            "django": true,
            "justMyCode": true
        }
    ]
}

If I edit the base.py:621 AWS_S3_URL_PROTOCOL as follows, then the images can be displayed, but the MinIO must have a Public Access Policy):

image image

But when I export the labeled datasets, the export zip file doesn't contain the image files, only the annotation file, result.json.

So, I continue to debug the code, I edit label_studio\data_export\serializers.py:77 , then I can export the image files. image

The MinIO configuration: image image

Last, those fixes may be wrong, because I am not good at Python and Django. I am looking forward to your professional answer, Thanks ~