分类:动作捕捉
github地址:https://github.com/ultralytics/ultralytics
所需环境:
Windows10,CUDA11.6,conda 4.13.0,Visual Studio 2017;
目录
- 环境搭建
- Conda list
- 使用测试
环境搭建
# 创建环境
conda create -n yolov8 python=3.8
conda activate yolov8
# 个人比较偏向从源码构建 不喜欢这种方式的同学请直接采用pip安装方式:pip install ultralytics
conda install git
cd D:
cd D:\WLm_Project\MotionCatch\YOLOV8
git clone https://github.com/ultralytics/ultralytics.git
cd ultralytics
# 创建Pytorch环境 torch-1.13.1+cu116-cp38-cp38-win_amd64.whl需要预下载并拷贝到当前目录 CUDA需要提前配置
pip install torch-1.13.1+cu116-cp38-cp38-win_amd64.whl
pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 -i https://pypi.tuna.tsinghua.edu.cn/simple
# 下载并安装ultralytics依赖项
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 编译ultralytics
pip install -v -e . -i https://pypi.tuna.tsinghua.edu.cn/simple
编译成功
Conda list
# packages in environment at D:\Anaconda3\envs\yolov8:
#
# Name Version Build Channel
ca-certificates 2023.05.30 haa95532_0
certifi 2023.7.22 pypi_0 pypi
charset-normalizer 3.2.0 pypi_0 pypi
colorama 0.4.6 pypi_0 pypi
contourpy 1.1.0 pypi_0 pypi
cycler 0.11.0 pypi_0 pypi
fonttools 4.42.1 pypi_0 pypi
idna 3.4 pypi_0 pypi
importlib-resources 6.0.1 pypi_0 pypi
kiwisolver 1.4.4 pypi_0 pypi
libffi 3.4.4 hd77b12b_0
matplotlib 3.7.2 pypi_0 pypi
numpy 1.24.4 pypi_0 pypi
opencv-python 4.8.0.76 pypi_0 pypi
openssl 3.0.10 h2bbff1b_0
packaging 23.1 pypi_0 pypi
pandas 2.0.3 pypi_0 pypi
pillow 10.0.0 pypi_0 pypi
pip 23.2.1 py38haa95532_0
psutil 5.9.5 pypi_0 pypi
py-cpuinfo 9.0.0 pypi_0 pypi
pyparsing 3.0.9 pypi_0 pypi
python 3.8.17 h1aa4202_0
python-dateutil 2.8.2 pypi_0 pypi
pytz 2023.3 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
requests 2.31.0 pypi_0 pypi
scipy 1.10.1 pypi_0 pypi
seaborn 0.12.2 pypi_0 pypi
setuptools 68.0.0 py38haa95532_0
six 1.16.0 pypi_0 pypi
sqlite 3.41.2 h2bbff1b_0
torch 1.13.1+cu116 pypi_0 pypi
torchaudio 0.13.1+cu116 pypi_0 pypi
torchvision 0.14.1+cu116 pypi_0 pypi
tqdm 4.66.1 pypi_0 pypi
typing-extensions 4.7.1 pypi_0 pypi
tzdata 2023.3 pypi_0 pypi
ultralytics 8.0.158 dev_0 <develop>
urllib3 2.0.4 pypi_0 pypi
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
wheel 0.38.4 py38haa95532_0
zipp 3.16.2 pypi_0 pypi
使用测试
训练教程: https://docs.ultralytics.com/modes/train/
验证教程:https://docs.ultralytics.com/modes/val/
预测教程:https://docs.ultralytics.com/modes/predict/
模型输出教程:https://docs.ultralytics.com/modes/export/
姿态估计教程:https://docs.ultralytics.com/tasks/pose/#val
读取结果在ultralytics\runs\pose中:
# python脚本
from ultralytics import YOLO
# python
# Load a model
model = YOLO('yolov8n-pose.pt') # load an official model
model = YOLO('path/to/best.pt') # load a custom model
# Predict with the model
results = model('https://ultralytics.com/images/bus.jpg') # predict on an image
# 命令行
# 读取屏幕
yolo pose predict model=yolov8n-pose.pt source='screen'
# 读取摄像头:找到ultralytics\ultralytics\cfg的default.yaml,show的值设成True,Flase的话不会实时看到画面。命令行令source=‘0’
yolo pose predict model=yolov8n-pose.pt source='0'