赞
踩
下载链接1: https://download.csdn.net/download/qq_45077760/89018721 (CSDN)
下载链接2:https://github.com/up-up-up-up/YOLOv8/tree/master (github)
注:我所做的是在10m以内的检测,没计算过具体误差,当然标定误差越小精度会好一点,其次注意光线、亮度等影响因素,当然检测范围效果跟相机的好坏也有很大关系
YOLOv8所需要python>=3.8,博主之前用的是3.7,配置到最后发现python3.7对应的numpy最高是1.21,而YOLOv8要求的numpy最低是1.22.2,因此需要创建一个虚拟环境
conda create -n yolov8 python=3.8
https://github.com/ultralytics/ultralytics,然后activate yolov8激活环境,安装requirements.txt里所需要的库,官网代码里requirements.txt文件是没有的,创建一个requirements.txt文件并把以下代码贴进去放在YOLOv8目录下,执行命令安装库
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
requirements.txt代码内容
# Ultralytics requirements
# Example: pip install -r requirements.txt
# Base ----------------------------------------
matplotlib>=3.3.0
numpy>=1.22.2 # pinned by Snyk to avoid a vulnerability
opencv-python>=4.6.0
pillow>=7.1.2
pyyaml>=5.3.1
requests>=2.23.0
scipy>=1.4.1
# torch>=1.8.0
# torchvision>=0.9.0
tqdm>=4.64.0
# Logging -------------------------------------
# tensorboard>=2.13.0
# dvclive>=2.12.0
# clearml
# comet
# Plotting ------------------------------------
pandas>=1.1.4
seaborn>=0.11.0
# Export --------------------------------------
# coremltools>=7.0 # CoreML export
# onnx>=1.12.0 # ONNX export
# onnxsim>=0.4.1 # ONNX simplifier
# nvidia-pyindex # TensorRT export
# nvidia-tensorrt # TensorRT export
# scikit-learn==0.19.2 # CoreML quantization
# tensorflow>=2.4.1,<=2.13.1 # TF exports (-cpu, -aarch64, -macos)
# tflite-support
# jax<=0.4.21 # tensorflowjs bug https://github.com/google/jax/issues/18978
# jaxlib<=0.4.21 # tensorflowjs bug https://github.com/google/jax/issues/18978
# tensorflowjs>=3.9.0 # TF.js export
# openvino-dev>=2023.0 # OpenVINO export
# Extras --------------------------------------
psutil # system utilization
py-cpuinfo # display CPU info
thop>=0.1.1 # FLOPs computation
# ipython # interactive notebook
# albumentations>=1.0.3 # training augmentations
# pycocotools>=2.0.6 # COCO mAP
# roboflow
接下来安装ultralytics和yolo包
pip install ultralytics -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install yolo -i https://pypi.tuna.tsinghua.edu.cn/simple
官网下载yolov8n.pt文件,并把他放在YOLOv8目录下,执行推理命令
yolo predict model=yolov8n.pt source='ultralytics/assets/bus.jpg'
如果遇到以下错误,执行命令
python setup.py install
官网下载代码里是没有setup.py文件的,创建上setup.py文件并把它放在YOLOv8目录下,当然这些缺失文件我会在我的工程代码里打包给大家
setup.py
# Ultralytics YOLO 声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/301605
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。