Running CVAT

On this page you will find necessary steps on how to run CVAT for local environment

In order to run CVAT locally, you need to pull their repository:

git clone https://github.com/opencv/cvat.git && cd cvat

Before running CVAT services, you will need to make some modifications to the docker-compose.yml file in order to enable communication between Human Protocol and CVAT containers.

If using "Docker Compose" version of protocol

First you need to add a network alias for traefik service by changing its networks section to:

networks:
  cvat:
    aliases:
      - cvat-lb

Then configure cvat network at the bottom of compose file:

networks:
  cvat:
    name: human-cvat-bridge
    external: true

In order to allow Human Protocol services to communicate with CVAT services you need to retrieve bridge network subnet CIDR:

docker network inspect human-cvat-bridge | grep Subnet | awk -F'"' '{print $4}'
# 172.19.0.0/16

and when you starting CVAT, specify --allow-range using that CIDR and cvat-lb alias as a host:

SMOKESCREEN_OPTS="--allow-range=172.19.0.0/16" \
    CVAT_HOST=cvat-lb \
    docker compose -f docker-compose.yml -f docker-compose.dev.yml \
    up -d

CVAT will be available on http://cvat-lb:8080, so make sure you added a mapping to your /etc/hosts/ for convenience, because it will allow requests only with Host: cvat-lb header

If using "localhost" version (i.e. services running locally)

If you use "localhost" setup, you will highly likely need to create bridge Docker network to be able to access CVAT services from local host:

docker network create \
    -o "com.docker.network.bridge.enable_icc=true" \
    -o "com.docker.network.bridge.enable_ip_masquerade=true" \
    -o "com.docker.network.driver.mtu=1500" \
    human-cvat-bridge

Then configure cvat network at the bottom of compose file:

networks:
  cvat:
    name: human-cvat-bridge
    external: true

In order to allow HUMAN Protocol services communicate with CVAT services you need to retrieve bridge network Gateway IP (traffic from your local host goes through this Gateway to containers):

docker network inspect human-cvat-bridge | grep Gateway
# 172.19.0.1

and when you starting CVAT, specify --allow-address using that IP:

SMOKESCREEN_OPTS="--allow-address=172.19.0.1/" \
    docker compose -f docker-compose.yml -f docker-compose.dev.yml \
    up -d

CVAT will be available on http://localhost:8080 and will allow requests only with Host: localhost header

Once you started - trigger a healthcheck to verify that CVAT works as expected:

docker exec -t cvat_server python manage.py health_check

Next you will need to create superuser to manage CVAT instance:

docker exec -it cvat_server bash -ic 'python3 ~/manage.py createsuperuser'

Then go to CVAT UI in your browser and create a user for HUMAN Protocol services. Then login as this user and create the organization for HUMAN Protocol.

For "Docker Compose" setup use username, password and organization short name from the docker-compose file (or overrides you specified there if any)

Last updated

Was this helpful?