前言


相关EdgeX Foundry 全部分类:
https://blog.csdn.net/freewebsys/category_9437788.html

本文的原文连接是:
https://blog.csdn.net/freewebsys/article/details/108971807

未经博主允许不得转载。
博主地址是:http://blog.csdn.net/freewebsys

1,关于CVAT项目


项目地址:
https://www.cvat.ai/
github地址:
https://github.com/openvinotoolkit/cvat

CVAT 全称 Computer Vision Annotation Tool,是用于计算机视觉的免费、在线、交互式视频和图像注释工具。
也可以使用docker-compose 进行本地部署。

2,使用docker-compose 进行本地部署


参考:
https://openvinotoolkit.github.io/cvat/docs/administration/basics/installation/#ubuntu-1804-x86_64amd64

git clone https://github.com/openvinotoolkit/cvat
cd cvat
docker-compose up -d

然后就是修改 admin管理员密码:

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

Username: admin
Email address: admin@admin.com
Password: 
Password (again): 
The password is too similar to the username.
This password is too short. It must contain at least 8 characters.
This password is too common.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.

然后访问本地 http://localhost:8080 就可以使用刚才创建的账号密码进行登录了。

在这里插入图片描述

创建成功之后可以
在这里插入图片描述
在这里插入图片描述

docker ps
CONTAINER ID   IMAGE                                 COMMAND                  CREATED          STATUS          PORTS                                                    NAMES
cd2f78c21ce4   openvino/cvat_ui                      "/docker-entrypoint.…"   14 minutes ago   Up 14 minutes   80/tcp                                                   cvat_ui
a9d46353da12   openvino/cvat_server                  "/usr/bin/supervisord"   14 minutes ago   Up 14 minutes   8080/tcp                                                 cvat
fa3ba4d0462f   redis:4.0-alpine                      "docker-entrypoint.s…"   14 minutes ago   Up 14 minutes   6379/tcp                                                 cvat_redis
58e7d5a78f0c   postgres:10-alpine                    "docker-entrypoint.s…"   14 minutes ago   Up 14 minutes   5432/tcp                                                 cvat_db
a5fb6ffbdba4   traefik:v2.4                          "/entrypoint.sh --pr…"   14 minutes ago   Up 14 minutes   0.0.0.0:8080->8080/tcp, 80/tcp, 0.0.0.0:8090->8090/tcp   traefik
d7f461aa856b   openpolicyagent/opa:0.34.2-rootless   "/opa run --server -…"   14 minutes ago   Up 14 minutes   0.0.0.0:8181->8181/tcp                                   cvat_opa


相关的镜像:
openvino/cvat_ui                                                             latest                                                  69a6a5d6e84a   4 months ago     50.4MB
openvino/cvat_server                                                         latest                                                  041f75bb1d7e   4 months ago     5.95GB
raefik                                                                      v2.4                                                    de1a7c9d5d63   12 months ago    92MB
redis                                                                        4.0-alpine                                              e3dd0e49bca5   2 years ago      20.4MB
postgres                                                                     10-alpine                                               8471b2130db7   2 days ago       79.2MB
openpolicyagent/opa                                                          0.34.2-rootless                                         f85ee8a15a91   9 months ago     71.9MB

依赖了 redis,postgres openpolicyagent/opa (这个不知道是啥)
最重要的就是后端服务:openvino/cvat_server 差不多 6G。
里面使用的是 django 做后台服务,组织成的代码。

$ ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
django       1     0  0 02:30 ?        00:00:05 /usr/bin/python3 /usr/bin/supervisord
django      10     1  0 02:30 ?        00:00:00 /usr/bin/ssh-agent -d -a /tmp/ssh-agent.sock
django      12     1  2 02:30 ?        00:02:36 python3 /home/django/manage.py update_git_states
django      13     1  0 02:30 ?        00:00:00 python3 /opt/venv/bin/rqscheduler --host cvat_redis -i 30
django      14     1  2 02:30 ?        00:02:36 python3 /home/django/manage.py rqworker -v 3 default
django      15     1  2 02:30 ?        00:02:36 python3 /home/django/manage.py rqworker -v 3 default
django      16     1  2 02:30 ?        00:02:36 python3 /home/django/manage.py rqworker -v 3 low
django      19     1  0 02:30 ?        00:00:08 apache2 (mod_wsgi-express) -f /tmp/cvat-server/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MOD
django     336    19  2 02:30 ?        00:02:28 (wsgi:localhost:8080:1000) -f /tmp/cvat-server/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MOD
django     337    19  0 02:30 ?        00:00:00 apache2 (mod_wsgi-express) -f /tmp/cvat-server/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MOD
django     374    19  0 02:42 ?        00:00:00 apache2 (mod_wsgi-express) -f /tmp/cvat-server/httpd.conf -DMOD_WSGI_MPM_ENABLE_EVENT_MOD
django     410     0  0 02:47 pts/0    00:00:00 bash
django     538   410  0 04:28 pts/0    00:00:00 ps -ef

使用了 supervisord 管理服务,运行 python3 环境,还使用了 apache2 做web服务,比较老的服务了。
项目主目录在 /home/django , 配置了7 个服务。

[unix_http_server]
file = /tmp/supervisord/supervisor.sock

[supervisorctl]
serverurl = unix:///tmp/supervisord/supervisor.sock


[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisord]
nodaemon=true
logfile=%(ENV_HOME)s/logs/supervisord.log ; supervisord log file
logfile_maxbytes=50MB       ; maximum size of logfile before rotation
logfile_backups=10          ; number of backed up logfiles
loglevel=debug              ; info, debug, warn, trace
pidfile=/tmp/supervisord/supervisord.pid ; pidfile location
childlogdir=%(ENV_HOME)s/logs/            ; where child log files will live

[program:ssh-agent]
command=bash -c "rm /tmp/ssh-agent.sock -f && /usr/bin/ssh-agent -d -a /tmp/ssh-agent.sock"
priority=1
autorestart=true

[program:rqworker_default]
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic \
    "exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 default"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=2
process_name=rqworker_default_%(process_num)s

[program:rqworker_low]
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic \
    "exec python3 %(ENV_HOME)s/manage.py rqworker -v 3 low"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=1

[program:git_status_updater]
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic \
    "python3 ~/manage.py update_git_states"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=1

[program:rqscheduler]
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_REDIS_HOST)s:6379 -t 0 -- bash -ic \
    "python3 /opt/venv/bin/rqscheduler --host %(ENV_CVAT_REDIS_HOST)s -i 30"
environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"
numprocs=1

[program:clamav_update]
command=bash -c "if [ \"${CLAM_AV}\" = 'yes' ]; then /usr/bin/freshclam -d \
    -l %(ENV_HOME)s/logs/freshclam.log --foreground=true; fi"
numprocs=1

[program:runserver]
; Here need to run a couple of commands to initialize DB and copy static files.
; We cannot initialize DB on build because the DB should be online. Also some
; apps are dynamically loaded by an environment variable. It can lead to issues
; with docker cache. Thus it is necessary to run collectstatic here for such
; apps.
command=%(ENV_HOME)s/wait-for-it.sh %(ENV_CVAT_POSTGRES_HOST)s:5432 -t 0 -- bash -ic \
    "rm -f /tmp/cvat-server/httpd.pid && python3 ~/manage.py migrate && \
    python3 ~/manage.py collectstatic --no-input && \
    exec python3 $HOME/manage.py runmodwsgi --log-to-terminal --port 8080 \
    --limit-request-body 1073741824 --log-level INFO --include-file ~/mod_wsgi.conf \
    %(ENV_DJANGO_MODWSGI_EXTRA_ARGS)s --locale %(ENV_LC_ALL)s \
    --server-root /tmp/cvat-server"

environment=SSH_AUTH_SOCK="/tmp/ssh-agent.sock"

项目前端代码:
https://github.com/openvinotoolkit/cvat/blob/develop/cvat-ui/package.json
在这里插入图片描述

使用ant-design + react 进行开发的。
后端lib库:

3,总结


https://openvinotoolkit.github.io/cvat/docs/getting_started/

CVAT 全称 Computer Vision Annotation Tool,是用于计算机视觉的免费、在线、交互式视频和图像注释工具。
也可以使用docker-compose 进行本地部署。部署在内网环境中,支持多人协同工作,而且还可以分配权限,进行各种学习使用。非常方便,用到了redis,postgres 存储数据,可以支持图片标准,还可以进行3D数据的标注,非常方便,项目也是MIT 开源协议的,前端使用ant-design + react 进行开发的,后端是 python3 django 开发的管理端。默认启动起来就可以直接使用。也可以自己修改代码进行二次开发。

本文的原文连接是:
https://blog.csdn.net/freewebsys/article/details/108971807

博主地址是:https://blog.csdn.net/freewebsys

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐