cvat 標圖工具部署文檔


ps: 由於此文檔比較久了。官網的cvat更新多次,已經不太適用了。 還是查看官方文檔進行構建. 需要注意的是,下面的nginx替換是因為使用了域名解析的方式,只要把default.conf配置文件修改了,不改域名也可以使用。這個就自己去查詢nginx的配置文件的匹配方式,這里就不多解釋了。歡迎加群一起交流

cvat 標圖工具部署文檔

地址: https://github.com/opencv/cvat/blob/develop/cvat/apps/documentation/installation.md

環境 CentOS7

部署基礎環境

部署docker

wget -O /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# 查看docker-ce版本
yum --showduplicates list docker-ce

# 安裝docker-ce
yum -y install docker-ce
# 啟動服務
systemctl enable docker
systemctl start docker

# 參考文檔 http://mirrors.ustc.edu.cn/help/dockerhub.html
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << EOF
{
  "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}
EOF
systemctl restart docker

部署docker-compose

yum install epel-release -y
yum install -y python36 python36-devel  python36-setuptools python python-devel python-setuptools
easy_install-3.6 pip
mkdir -p /root/.pip 
echo [global] >> ~/.pip/pip.conf
echo index-url = https://mirrors.aliyun.com/pypi/simple/ >> ~/.pip/pip.conf
echo [install] >> ~/.pip/pip.conf
echo trusted-host=mirrors.aliyun.com >> ~/.pip/pip.conf
python3 -m pip install docker-compose

拉取代碼

yum install -y git
git clone https://github.com/opencv/cvat
cd cvat
# 根據自己需要,切換分支
git branch -a 
git checkout release-1.0.0

構建鏡像並且啟動

因為鏡像使用的國外源,需要修改部分內容

使用清華ubuntu源

Dockerfile文件

# 原本內容
FROM ubuntu:16.04
# 第二行直接替換
RUN echo deb http://mirrors.aliyun.com/ubuntu/ xenial main                    > /etc/apt/sources.list
RUN echo deb-src http://mirrors.aliyun.com/ubuntu/ xenial main                >> /etc/apt/sources.list
RUN echo                                                                      >> /etc/apt/sources.list
RUN echo deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main            >> /etc/apt/sources.list
RUN echo deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main        >> /etc/apt/sources.list
RUN echo                                                                      >> /etc/apt/sources.list
RUN echo deb http://mirrors.aliyun.com/ubuntu/ xenial universe                >> /etc/apt/sources.list
RUN echo deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe            >> /etc/apt/sources.list
RUN echo deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe        >> /etc/apt/sources.list
RUN echo deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe    >> /etc/apt/sources.list
RUN echo                                                                      >> /etc/apt/sources.list
RUN echo deb http://mirrors.aliyun.com/ubuntu/ xenial-security main           >> /etc/apt/sources.list
RUN echo deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main       >> /etc/apt/sources.list
RUN echo deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe       >> /etc/apt/sources.list
RUN echo deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe   >> /etc/apt/sources.list

Dockerfile

# 修改對應的內容,加上 -i 指定阿里雲源
RUN python3 -m pip install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt -i https://mirrors.aliyun.com/pypi/simple/
RUN python3 -m pip install --no-cache-dir -r ${HOME}/datumaro/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

Dockerfile.ci

# 修改
RUN python3 -m pip install --no-cache-dir -r /tmp/requirements/${DJANGO_CONFIGURATION}.txt -i https://mirrors.aliyun.com/pypi/simple/

vim Dockerfile.ui

添加一句,使用國內源

# 添加
RUN npm config set registry https://registry.npm.taobao.org

啟動

docker-compose build

啟動

docker-compose up -d

訪問只能是chrome 谷歌瀏覽器
訪問必報404錯誤,除了 http://localhost:8080 因為nginx的配置文件默認訪問是404,而默認的 CVAT_HOST 是localhost

修改nginx配置文件

推薦不修改

./cvat_proxy/conf.d/cvat.conf.template

使用域名解析

docker-compose.override.yml

version: "2.3"
services:
  cvat_proxy:
    environment:
	  CVAT_HOST: test.example.com

然后在hosts配置

127.0.0.1 test.example.com

訪問只能是chrome 谷歌瀏覽器
訪問:http://test.example.com:8080

創建超級用戶

使用的是django的admin系統,直接使用下面命令創建

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

使用超級用戶進入管理后台

訪問: http://test.example.com:8080/admin

然后使用管理管理后台 管理用戶

如果需要安裝插件,請注意查看文檔,並且找到文檔修改源

components/analytics/logstash/Dockerfile

ARG ELK_VERSION
FROM docker.elastic.co/logstash/logstash-oss:${ELK_VERSION}
# 新增加
RUN sed -i 's#source "https://rubygems.org"#source "https://mirrors.aliyun.com/rubygems/"#g' Gemfile
RUN logstash-plugin install logstash-input-http logstash-filter-aggregate \
    logstash-filter-prune logstash-output-email

COPY logstash.conf   /usr/share/logstash/pipeline/
EXPOSE 5000

下載openvino依賴包,請到官網查找 https://software.intel.com/zh-cn/openvino-toolkit

cd components/openvino/
#wget l_openvino_toolkit_p_2020.2.120.tgz

components/auto_segmentation/install.sh 這個文件的請到自己網速較快的服務器 clone 和curl到本地,然后修改

#!/bin/bash
#

set -e
# 修改此處,由於我使用的是企業的倉庫,這里就不做暴露了
MASK_RCNN_URL=https://github.com/matterport/Mask_RCNN

cd ${HOME} && \
git clone ${MASK_RCNN_URL}.git 
#curl -L ${MASK_RCNN_URL}/releases/download/v2.0/mask_rcnn_coco.h5 -o Mask_RCNN/mask_rcnn_coco.h5

# TODO remove useless files
# tensorflow and Keras are installed globally

修改 components/tf_annotation/install.sh

curl 的命令
  • docker-compose.override.yml 自定義修改內容,修改訪問域名
  • components/analytics/docker-compose.analytics.yml 分析
  • components/auto_segmentation/docker-compose.auto_segmentation.yml 自動標注
  • components/openvino/docker-compose.openvino.yml openfino安裝
  • components/tf_annotation/docker-compose.tf_annotation.yml tf標圖工具
  • components/cuda/docker-compose.cuda.yml 安裝cuda,此處沒有安裝,即沒測試,不做使用
    完整體命令
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f components/analytics/docker-compose.analytics.yml -f components/auto_segmentation/docker-compose.auto_segmentation.yml -f components/openvino/docker-compose.openvino.yml -f components/tf_annotation/docker-compose.tf_annotation.yml up -d --build

廣告時間:
推薦K8S學習網址 https://kubernetes.hankbook.cn


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM