Win 10 环境 DepthAI 安装教程
在Win 10上安装DepthAI【OpenCV OAK人工智能套件】
-
打开 docs.oakchina.cn 网站
-
转到 Python API 页面, 翻到 安装系统依赖 - Windows 处
-
安装 Chocolatey 软件包管理器(类似于 macOS 的 Homebrew)
-
单击 开始按钮 ,找到 Windows PowerShell 右键单击 选择 以管理员身份运行
-
PowerShell 运行下方命令 ,安装 Chocolatey 软件包管理器
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
-
-
安装 Python 和 PyCharm 等环境
-
重新打开 PowerShell (管理员)
-
PowerShell 运行下方命令, 安装系统依赖
choco install cmake git python pycharm-community -y
-
注:
此步可能会产生网络错误等问题,可以重复运行多次(会消耗大量时间)
-
使用 pypi 镜像 (可选)
-
重新打开 PowerShell (管理员)
-
PowerShell 运行下方命令, 配置镜像
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
-
-
使用 GitHub 镜像 (可选)
- 下载 https://github.com/fastgh/fgit/releases/download/v1.0.0/fgit.exe
- 复制下载的
fgit.exe
到C:\Program Files\Git\cmd
目录下
-
安装并测试 DepthAI (此时 DepthAI(OAK-D)应该连接在电脑上)
-
单击 开始按钮 ,找到 JetBrains 文件夹,打开 PyCharm
-
单机 New Project (新建项目),默认创建即可
-
等待加载完成
-
打开 右下角 Terminal
-
Terminal 运行下方命令,克隆 depthai 存储库
git clone https://github.com/luxonis/depthai.git
使用 GitHub 镜像 的可以执行
fgit clone https://github.com/luxonis/depthai.git
加速克隆存储库
-
输入并运行
cd depthai
命令 ,将目录更改为该目录 -
Terminal 运行下方命令,安装依赖项(Win 10 使用 python 命令 ,Linux与MacOS 使用 python3)
python install_requirements.py
-
在 pycharm 左侧 project 工作区中打开 depthai 文件夹 找到 depthai_demo.py 文件并打开
-
在代码区右键选择 Run(运行)运行代码
-