Weka Label Studio kwenye Ubuntu 24.04

Label Studio inakusaidia kuweka lebo kwenye maandishi, picha, sauti, na video. Unaweza kuitumia kwa michakato ya machine learning na ushirikiano wa timu.

Mwongozo huu unakuonyesha jinsi ya kuweka Label Studio ukitumia Docker Compose na Traefik. Traefik hutoa HTTPS ya kiotomatiki kwa domain yako.

Fuata hatua hizi kuisanidi.

  1. Tayarisha directory yako

Endesha amri hizi ili kutengeneza folda kwa ajili ya mradi wako:

$ mkdir ~/labelstudio $ cd ~/labelstudio

  1. Sanidi variable zako za mazingira

Tengeneza faili la .env:

$ nano .env

Ongeza domain na barua pepe yako:

DOMAIN=labelstudio.example.com LETSENCRYPT_EMAIL=admin@example.com

  1. Tengeneza faili la Docker Compose

Tengeneza faili linaloitwa docker-compose.yaml:

$ nano docker-compose.yaml

Bandika usanidi huu:

services:
  traefik:
    image: traefik:v3.6
    container_name: traefik
    command:
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
      - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge=true"
      - "--certificatesresolvers.letsencrypt.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.letsencrypt.acme.email=${LETSENCRYPT_EMAIL}"
      - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "./letsencrypt:/letsencrypt"
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    restart: unless-stopped

  labelstudio:
    image: heartexlabs/label-studio:1.23.0
    container_name: labelstudio
    expose:
      - "8080"
    environment:
      - DJANGO_ALLOWED_HOSTS=${DOMAIN}
      - CSRF_TRUSTED_ORIGINS=https://${DOMAIN}
      - USE_X_FORWARDED_HOST=true
      - SECURE_PROXY_SSL_HEADER=HTTP_X_FORWARDED_PROTO,https
    volumes:
      - ./data:/label-studio/data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.labelstudio.rule=Host(`${DOMAIN}`)"
      - "traefik.http.routers.labelstudio.entrypoints=websecure"
      - "traefik.http.routers.labelstudio.tls.certresolver=letsencrypt"
      - "traefik.http.services.labelstudio.loadbalancer.server.port=8080"
    restart: unless-stopped
  1. Weka ruhusa na uanze

Tengeneza folda ya data:

$ mkdir data $ sudo chown :0 data

Endesha huduma:

$ docker compose up -d

  1. Hakiki usanidi

Angalia ikiwa kontena zako zinaendeshwa:

$ docker compose ps

Ingia kwenye zana yako kupitia https://labelstudio.example.com. Jisajili ili kuunda akaunti yako ya admin.

Hatua zinazofuata kwa mradi wako:

Chanzo: https://dev.to/vultr/deploying-label-studio-open-source-data-labeling-platform-on-ubuntu-2404-5bd0

Jumuiya ya kujifunza ya hiari: https://t.me/GyaanSetuAi