yolo26目标检测尝鲜测试
摘要:本文介绍了如何配置Ultralytics YOLOv8.4.2环境并进行模型训练和推理。首先从GitHub下载官方代码,安装指定版本的PyTorch和依赖项。环境配置完成后,通过Python脚本加载预训练的YOLO26n模型,展示模型信息,并在COCO8数据集上进行100个epoch的训练。最后使用训练好的模型对示例图像"bus.jpg"进行目标检测推理并可视化结果。整个
·
下载Ultralytics官方代码,https://github.com/ultralytics/ultralytics/releases/tag/v8.4.2
环境配置:
pip install torch==2.9.0 torchvision==0.24.0 --index-url https://download.pytorch.org/whl/cu128
pip install -e .
python测试脚本:
from ultralytics import YOLO
# Load a COCO-pretrained YOLO26n model
model = YOLO("yolo26n.pt")
# Display model information (optional)
model.info()
# Train the model on the COCO8 example dataset for 100 epochs
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
# Run inference with the YOLO26n model on the 'bus.jpg' image
results = model("bus.jpg")
results[0].show()

更多推荐
所有评论(0)