Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Note: These are instructions on how to set up a serverless (aka offline) setup for CVAT. We usually stick with the web-based app app.cvat.ai which does not require any of these steps.

Expand
titleTable of Contents
Table of Contents
stylenone

Installing the Necessary Programs

Windows Subsystem for Linux (WSL)

Expand
titlenotes from google doc

Accessing Windows PowerShell

  1. Using the search bar located on the bottom of the screen, search for “PowerShell”

  2. Open the Windows PowerShell application by either double clicking the application name or by clicking Open

Installing Windows Subsystem for Linux (WSL)

  1. In the PowerShell terminal, type

    Code Block
languagepowershell
  1. wsl --install
  1. and then hit the Enter key

  • The --install command performs the following actions:

    • Enables the optional WSL and Virtual Machine Platform components

    • Downloads and installs the latest Linux kernel

    • Sets WSL 2 as the default

    • Downloads and installs the Ubuntu Linux distribution

Note

After the installation is complete you will need to Reboot your machine.

Google Chrome

Install Google Chrome

There are multiple methods of installing Google Chrome to your machine but in this guide we will only cover two: installing using winget and installing from a link

Installing using winget

  1. In Windows PowerShell type the following into the terminal

    Code Block
language
powershell
  1. winget install google.chrome
  1. and then press Enter

To see details about the program before you install, run the command winget show google.chrome first

  • The terminal may then prompt you with the following:

    Code Block
languagepowershell
  • The `msstore` source requires that you view the following agreements before using.
    
    Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
    
    The source requires the current machine's 2-letter geographic region to be sent to the backend service to function properly (ex. "US").
  • 
    
    Do you agree to all the source agreements terms?
    
    [Y] Yes  [N] No:
  • Type Yto continue

  1. Google Chrome will install to your machine.

Open the following link in a web browser of your choosing.

https://www.google.com/chrome/

  1. Click on the Download Chrome button

  2. Save the file to your computer

  3. Open the file and follow the prompts

Docker Desktop

Expand
titlenotes from google docs
  • Install Docker Desktop

    • Use winget again

      • Code Block
        winget install Docker.DockerDesktop
        • You may need to agree to the source agreements again first, just type Y

    • Or install using this link: https://docs.docker.com/desktop/setup/install/windows-install/  

    • Once installed, open Docker Desktop and click on the cog wheel to access settings

    • Click on Resources in the sidebar

    • Click on WSL Integration on the sidebar

    • Ensure that the box next to “Enable integration with my default WSL distro” is checked

    • Click the toggle for “Enable integration with additional distros:” to turn it on as well for good measure

    • Click “Apply and Restart”

    • Note: for some unknown reason quitting docker desktop does not actually end the program and tasks, you have to end the tasks in task manager to fully shut it down or you need to quit docker from the hidden icons in the taskbar

Git

Expand
titlenotes from google docs

Windows Terminal

Expand
titlenotes from google docs

Install Terminal (Optional)

Note: for silent install use msiexec, see more at https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/msiexec t

Note to obtain computer specifications

  • In PowerShell on Windows 

    Code Block
     command Get-ComputerInfo -Property “os*”
    • Will tell you all the specifications of your operating system

  • Or command

    Code Block
    Get-ComputerInfo -Property “osname”
    • Will only tell you the name of the operating system (i.e. Microsoft Windows 11 Pro)


Installing CVAT

Expand
titlenotes from google docs
  • Windows

    • Run the Linux distribution that was installed (Ubuntu) by searching Ubuntu in the start menu and running it

    • Or search for Terminal in the start menu and right click on it and Select Ubuntu in the dropdown

    • In the window that opens type the following to clone the CVAT source code from the github repository

      • Code Block
        git clone https://github.com/cvat-ai/cvat
    • Change to the cvat directory you just made

      • Code Block
        cd cvat
    • Run docker containers

      • Code Block
        docker compose up -d
    • Create a superuser 

      • Code Block
        sudo docker exec -it cvat_server bash -ic 'python3 ~/manage.py createsuperuser'
        • Input the administrator password when prompted

          •  Note, the characters that you type will NOT show up in the window, when you’re finished typing the password just hit the “enter” key

        • Create a username (default is django) 

          • If you want to use the default just hit enter

        • Input your email when prompted

        • Create a password for your user

          • Note the characters that you enter will not appear in the window

            • Hit enter when done

        • Re-input the password

          • The characters will not appear in the window


Opening CVAT

Expand
titlenotes from google docs

Opening CVAT

  • Open Google Chrome 

  • Go to localhost:8080

  • Type your login and password for the superuser and press the login button


Installing the Segment Anything Model (SAM)

Expand
titlenotes from google docs

SAM installation

  • https://github.com/facebookresearch/segment-anything?ref=blog.roboflow.com

  • Windows 

    • Bring up CVAT with auto annotation tool

    • Open ubuntu

    • Change to cvat directory

    • Stop any docker containers using docker compose down

    • Run 

      • Code Block
        docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml up -d
    • To stop containers 

      • Code Block
        docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml down
    • Install nuclio

      • https://github.com/nuclio/nuclio#quick-start-steps

      • Important:

        • CHECK WHAT VERSION OF NUCTL IS CALLED FOR IN DOCKER-COMPOSE.SERVERLESS.YML

          • Do this by using the in terminal text editor nano

          • To open a specific file using nano type nano <filepath>

            • To open docker-compose.serverless.yml

              • Code Block
                nano components/serverless/docker-compose.serverless.yml
              • Look at what version number is listed under “image:”

                • In this case it is 1.13.0

            • To close nano press CTRL+X

      • Use wget to pull the specific version of nuclio that matches what is found in docker-compose.serverless.yml

      • wget https://github.com/nuclio/nuclio/releases/download/ <version>/nuctl-<version>-linux-amd64

        • Where <version> is replaced by the number that you need

        • So

          • Code Block
            wget https://github.com/nuclio/nuclio/releases/download/1.13.0/nuctl-1.13.0-linux-amd64 
      • Give nuclio the permissions to do a soft link

        • Code Block
          sudo chmod +x nuctl-<version>-linux-amd64
          sudo ln -sf $(pwd)/nuctl-<version>-linux-amd64 /usr/local/bin/nuctl
          • Where <version> is the version you downloaded

            • Code Block
              sudo chmod +x nuctl-1.13.0-linux-amd64
            • Code Block
              sudo ln -sf $(pwd)/nuctl-1.13.0-linux-amd64 /usr/local/bin/nuctl
      • Deploy a couple functions

        Code Block
        ./serverless/deploy_cpu.sh serverless/openvino/dextr
        ./serverless/deploy_cpu.sh serverless/openvino/omz/public/yolo-v3-tf
      • Open nuclio dashboard using

        • Localhost:8070

      • Deploy SAM function

        • Code Block
          cd serverless && ./deploy_cpu.sh pytorch/facebookresearch/sam/nuclio/


Running CVAT and SAM

Expand
titlenotes from google docs

Starting up CVAT with SAM

  • Open docker

    • Optional: close docker window

  • Open ubuntu

    • Change to cvat root directory

      • Code Block
        cd cvat
    • If SAM is installed 

      • Run 

        • Code Block
          docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml up -d
      • Then run

        • Code Block
          cd serverless && ./deploy_cpu.sh pytorch/facebookresearch/sam/nuclio/
    • If SAM is not installed

      • Code Block
        docker compose up -d
  • Open Chrome

    • Go to localhost:8080

    • Login

  • You have now opened CVAT

If SAM is installed

If SAM is not installed


Shutting Everything Down

Stopping CVAT

Stopping Docker

Expand
titlenotes from google docs

To stop Docker containers

In ubuntu type

  • Code Block
    docker compose down

    or

  • Code Block
    docker compose -f docker-compose.yml -f components/serverless/docker-compose.serverless.yml down