YOLOv12当前需要通过GitHub源码安装,以下是详细的跨平台安装指南:
基础环境准备:
- Python 3.11+(推荐3.11.4)
- Sistema de controle de versão Git
- NVIDIA GPU驱动(可选,但强烈建议)和CUDA 11.8+
通用安装步骤:
- Armazém de Clonagem:
git clone https://github.com/sunsmarterjie/yolov12.git
- 创建虚拟环境(推荐Conda):
conda create -n yolov12 python=3.11
- 安装PyTorch(需匹配CUDA版本):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
- Instale a dependência:
pip install -r requirements.txt
操作系统特需配置:
- Windows (computador):需要手动安装Visual Studio Build Tools(C++组件)
- macOS:M系列芯片需使用
conda install -c apple tensorflow-deps
解决兼容性问题 - Linux:推荐Ubuntu 20.04+,注意CUDA驱动版本匹配
验证安装成功可执行:python -c "from ultralytics import YOLO; print('YOLOv12 installed successfully')"
Essa resposta foi extraída do artigoYOLOv12: uma ferramenta de código aberto para detecção de alvos em imagens e vídeos em tempo realO