ai-computer-vision
2023.4
false
  • 发行说明
    • 2023.4.10.2
    • 2023.4.10.1
    • 2023.4.0
  • 概述
  • 设置和配置
    • 软件要求
    • 硬件要求
    • 部署服务器
    • 连接到服务器
    • 许可
  • 数据存储空间
重要 :
新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

AI Computer Vision 用户指南

上次更新日期 2024年11月11日

部署服务器

如果要使用 Microsoft Windows 或 Ubuntu 上的 Docker 或 Red Hat Enterprise Linux 上的 Podman 部署自己的 Computer Vision 服务器,并将其与“Computer Vision”活动一起使用,请按照以下步骤操作。

Microsoft Windows

Before deploying the server, make sure to check the software and hardware requirements.

安装 WSL

首先,必须在您的计算机上安装 WSL。

要安装 WSL,请运行以下命令,其中 {distribution} 是要使用的 Linux 发行版:
wsl --install -d {distribution}wsl --install -d {distribution}
注意:对于此安装过程,推荐的操作系统是 Ubuntu。

安装 NVIDIA 驱动程序

要在 Windows 计算机上运行计算机视觉服务器,您必须从 NVIDIA 官方网站下载并在具有兼容GeForce或 NVIDIA RTX/Quadro 卡的系统上安装 NVIDIA Windows 11 显示驱动程序。

重要提示: WSL 中安装的任何类型的 Linux 显示驱动程序都可能导致错误。

安装 Podman 和 NVIDIA 容器工具包

您可以通过运行以下脚本来安装 Podman 和 NVIDIA 容器工具包:

https://github.com/UiPath/Infrastructure/blob/main/ML/ml_prereq_all.shhttps://github.com/UiPath/Infrastructure/blob/main/ML/ml_prereq_all.sh

运行服务器

要运行计算机视觉服务器,您必须在 WSL Linux 终端中运行以下命令:

podman run -p 8501:5000 --hooks-dir=/usr/share/containers/oci/hooks.d/ \--security-opt=label=disable --device=nvidia.com/gpu=all controls_detection eula=acceptpodman run -p 8501:5000 --hooks-dir=/usr/share/containers/oci/hooks.d/ \--security-opt=label=disable --device=nvidia.com/gpu=all controls_detection eula=accept

使服务器在网络上可用

为了使服务器在本地网络上可见,必须在 Windows 上创建防火墙规则,并为计算机视觉服务器可用的端口创建入站规则。 默认情况下,端口为 8501

由于在 WSL 中运行的 Linux 实例具有自己的虚拟网络接口控制器,因此流向主机 IP 的流量不会直接重定向到 Linux 实例的 IP。 通过使用以下命令将主机 IP 的流量转发到 Linux 实例,可以绕过此问题:

netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8501 connectaddress=$wsl_ip connectport=8501netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8501 connectaddress=$wsl_ip connectport=8501

可以使用以下命令找到 WSL IP:

wsl -d {distribution} hostname -Iwsl -d {distribution} hostname -I
注意: 在 Windows 上使用 Docker Desktop 时不会出现此问题。

自动启动服务器

使用直接安装在 Linux 上的 Docker 引擎时,要在计算机引导时自动启动服务器,必须在 Windows 中创建计划任务。 此任务在系统启动时执行,并运行以下 PowerShell 脚本,其中 {distribution} 是已安装的 Linux 分发版:
wsl -d {distribution} echo "starting...";
$wsl_ips = (wsl -d {distribution} hostname -I);
$host_ip = $wsl_ips.Split(" ")[0];
netsh interface portproxy add v4tov4 listenport=8501 listenaddress=0.0.0.0 connectport=8501 connectaddress=$host_ip;
wsl -d {distribution} -u root service docker start;
wsl -d {distribution} -u root docker run -p 8501:5000 --gpus all controls_detection eula=accept;wsl -d {distribution} echo "starting...";
$wsl_ips = (wsl -d {distribution} hostname -I);
$host_ip = $wsl_ips.Split(" ")[0];
netsh interface portproxy add v4tov4 listenport=8501 listenaddress=0.0.0.0 connectport=8501 connectaddress=$host_ip;
wsl -d {distribution} -u root service docker start;
wsl -d {distribution} -u root docker run -p 8501:5000 --gpus all controls_detection eula=accept;

安装限制

此安装过程需要支持嵌套虚拟化的计算机。 目前,大多数 Cloud 虚拟机不支持 GPU 计算机的嵌套虚拟化。 总之,此安装流程最适合拥有带 GPU 的物理 Windows 服务器的客户。

Linux RHEL/Ubuntu

Before deploying the server, make sure to check the software and hardware requirements.

此页面上列出的所有命令都应在 GPU 计算机上的终端中执行。

下载 Computer Vision 服务器图像导出

保存销售代表在当前终端会话中提供给您的链接:

export CV_URL="LINK_FROM_SALES_REP"export CV_URL="LINK_FROM_SALES_REP"

下载导出:

wget "$CV_URL" -O controls_detection.tarwget "$CV_URL" -O controls_detection.tar

将图像加载到 Podman 中

运行以下命令:

podman load -i controls_detection.tarpodman load -i controls_detection.tar

启动服务器

运行以下命令:

podman run -p 8501:5000 --hooks-dir=/usr/share/containers/oci/hooks.d/ \--security-opt=label=disable --device=nvidia.com/gpu=all controls_detection eula=acceptpodman run -p 8501:5000 --hooks-dir=/usr/share/containers/oci/hooks.d/ \--security-opt=label=disable --device=nvidia.com/gpu=all controls_detection eula=accept

升级 Computer Vision 模型

升级模型等同于安装模型的新版本。这是因为升级意味着更改模型本身及其二进制文件,这不可避免地会导致服务器停止工作。

如果要在完全相同的服务器计算机上执行升级,则预计会出现停机。为避免这种情况,您只需在另一台服务器计算机上安装新版本,并在安装完成后将流量切换到该计算机即可。

标准升级方案如下所示:

  1. 准备并宣布停机时间(如果适用)。
  2. 安装新型号以代替旧型号。
  3. 运行服务器。

如果您的环境使用多节点负载均衡器设置,则可以通过每次重新安装每个节点来完全避免停机。

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。