Development environment
-
Install necessary dependencies:
Ubuntu 18.04
sudo apt-get update && sudo apt-get --no-install-recommends install -y build-essential curl redis-server python3-dev python3-pip python3-venv python3-tk libldap2-dev libsasl2-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
# Install Node.js 16 curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - sudo apt-get install -y nodejs
MacOS 10.15
brew install git python pyenv redis curl openssl node
-
Install FFmpeg libraries (libav*) version 4.0 or higher.
-
Install Visual Studio Code for development
-
Install CVAT on your local host:
git clone https://github.com/openvinotoolkit/cvat cd cvat && mkdir logs keys python3 -m venv .env . .env/bin/activate pip install -U pip wheel setuptools pip install -r cvat/requirements/development.txt python manage.py migrate python manage.py collectstatic
Note for Mac users
If you have any problems with installing dependencies from
cvat/requirements/*.txt
, you may need to reinstall your system python In some cases after system update it can be configured incorrectly and cannot compile some native modules -
Create a super user for CVAT:
$ python manage.py createsuperuser Username (leave blank to use 'django'): *** Email address: *** Password: *** Password (again): ***
-
Install npm packages for UI and start UI debug server (run the following command from CVAT root directory):
npm ci && npm run start:cvat-ui
Note for Mac users
If you faced with error
Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (57)
Read this article Node Sass does not yet support your current environment
-
Open new terminal (Ctrl + Shift + T), run Visual Studio Code from the virtual environment
source .env/bin/activate && code
-
Install following VS Code extensions:
-
Reload Visual Studio Code from virtual environment
-
Select
server: debug
configuration and start it (F5) to run REST server and its workers
You have done! Now it is possible to insert breakpoints and debug server and client of the tool.
Note for Windows users
You develop CVAT under WSL (Windows subsystem for Linux) following next steps.
-
Install WSL using this guide.
-
Following this guide install Ubuntu 18.04 Linux distribution for WSL.
-
Run Ubuntu using start menu link or execute next command
wsl -d Ubuntu-18.04
-
Run all commands from this installation guide in WSL Ubuntu shell.
-
You might have to manually start the redis server in wsl before you can start the configuration inside Visual Studio Code. You can do this with
sudo service redis-server start
. Alternatively you can also use a redis docker image instead of using the redis-server locally.