跳至内容

Ultralytics YOLO 常见问题(FAQ)

本常见问题部分讨论用户在使用软件库时可能遇到的常见问题。 UltralyticsYOLO 库时可能遇到的常见问题。

常见问题

Ultralytics 是什么?它能提供什么?

Ultralytics is a computer vision AI company specializing in state-of-the-art object detection and image segmentation models, with a focus on the YOLO (You Only Look Once) family. Their offerings include:

如何安装Ultralytics 软件包?

使用 pip 可以直接安装Ultralytics 软件包:

pip install ultralytics

如需最新开发版本,请直接从 GitHub 代码库安装:

pip install git+https://github.com/ultralytics/ultralytics.git

详细安装说明见快速入门指南

运行Ultralytics 模型的系统要求是什么?

最低要求:

  • Python 3.7+
  • PyTorch 1.7+
  • CUDA-兼容GPU (用于GPU 加速)

建议设置

  • Python 3.8+
  • PyTorch 1.10+
  • NVIDIA GPU CUDA 11.2+
  • 8GB+ 内存
  • 50GB+ 可用磁盘空间(用于数据集存储和模型训练)

有关常见问题的故障排除,请访问YOLO 常见问题页面。

How can I train a custom YOLO11 model on my own dataset?

To train a custom YOLO11 model:

  1. 在 YOLO 格式(图像和相应的标签 TXT 文件)。
  2. 创建一个描述数据集结构和类的 YAML 文件。
  3. 使用以下命令 Python 开始训练的代码:
from ultralytics import YOLO

# Load a model
model = YOLO("yolov8n.yaml")  # build a new model from scratch
model = YOLO("yolov8n.pt")  # load a pretrained model (recommended for training)

# Train the model
results = model.train(data="path/to/your/data.yaml", epochs=100, imgsz=640)

如需更深入的指南,包括数据准备和高级培训选项,请参阅综合培训指南

Ultralytics 中有哪些预训练模型?

Ultralytics offers a diverse range of pretrained YOLO11 models for various tasks:

  • Object Detection: YOLO11n, YOLO11s, YOLO11m, YOLO11l, YOLO11x
  • Instance Segmentation: YOLO11n-seg, YOLO11s-seg, YOLO11m-seg, YOLO11l-seg, YOLO11x-seg
  • Classification: YOLO11n-cls, YOLO11s-cls, YOLO11m-cls, YOLO11l-cls, YOLO11x-cls

These models vary in size and complexity, offering different trade-offs between speed and accuracy. Explore the full range of pretrained models to find the best fit for your project.

如何使用训练有素的Ultralytics 模型进行推理?

要使用经过训练的模型执行推理,请执行以下操作:

from ultralytics import YOLO

# Load a model
model = YOLO("path/to/your/model.pt")

# Perform inference
results = model("path/to/image.jpg")

# Process results
for r in results:
    print(r.boxes)  # print bbox predictions
    print(r.masks)  # print mask predictions
    print(r.probs)  # print class probabilities

有关批处理和视频推理等高级推理选项,请查看详细的预测指南

Ultralytics 模型能否部署在边缘设备或生产环境中?

完全正确!Ultralytics 型号专为在各种平台上进行多功能部署而设计:

  • 边缘设备:使用TensorRT 、ONNX 或OpenVINO 优化NVIDIA Jetson 或Intel Neural Compute Stick 等设备上的推理。
  • 移动:通过将模型转换为 TFLite 或 Core ML,在Android 或iOS 设备上部署。
  • Cloud: Leverage frameworks like TensorFlow Serving or PyTorch Serve for scalable cloud deployments.
  • 网络:使用ONNX.js 或TensorFlow.js 实现浏览器内推理。

Ultralytics 提供导出功能,可将模型转换为各种格式,以便部署。探索各种部署选项,找到最适合您使用情况的解决方案。

What's the difference between YOLOv8 and YOLO11?

主要区别包括

  • Architecture: YOLO11 features an improved backbone and head design for enhanced performance.
  • Performance: YOLO11 generally offers superior accuracy and speed compared to YOLOv8.
  • Tasks: YOLO11 natively supports object detection, instance segmentation, and classification in a unified framework.
  • Codebase: YOLO11 is implemented with a more modular and extensible architecture, facilitating easier customization and extension.
  • Training: YOLO11 incorporates advanced training techniques like multi-dataset training and hyperparameter evolution for improved results.

For an in-depth comparison of features and performance metrics, visit the YOLO comparison page.

如何为Ultralytics 开源项目做出贡献?

向Ultralytics 投稿是改进项目和扩展技能的好方法。以下是您的参与方式:

  1. 分叉 Ultralytics GitHub 上的存储库。
  2. 为您的功能或 bug 修复创建一个新分支。
  3. 进行更改并确保所有测试都通过。
  4. 提交拉取请求,并明确说明您的更改。
  5. 参与代码审查过程。

您还可以通过报告错误、建议功能或改进文档来作出贡献。有关详细指南和最佳实践,请参阅贡献指南

如何在Python 中安装Ultralytics 软件包?

在Python 中安装Ultralytics 软件包非常简单。使用 pip,在终端或命令提示符下运行以下命令:

pip install ultralytics

如需最先进的开发版本,请直接从 GitHub 代码库安装:

pip install git+https://github.com/ultralytics/ultralytics.git

有关特定环境的安装说明和故障排除技巧,请查阅综合快速入门指南

Ultralytics YOLO 的主要功能是什么?

Ultralytics YOLO 它拥有丰富的功能,可用于高级对象检测和图像分割:

  • 实时检测:在实时场景中高效检测物体并对其进行分类。
  • 预训练模型:访问各种预训练模型,针对不同的使用案例在速度和准确性之间取得平衡。
  • 自定义训练:利用灵活的训练管道,在自定义数据集上轻松微调模型。
  • 广泛的部署选项:将模型导出为各种格式,如TensorRT 、ONNX 和CoreML ,以便在不同平台上部署。
  • 广泛的文档:受益于全面的文档和支持性社区,指导您完成计算机视觉之旅。

访问YOLO 型号页面,深入了解不同YOLO 版本的功能和架构。

如何提高YOLO 型号的性能?

提高YOLO 模型的性能可以通过几种技术来实现:

  1. Hyperparameter Tuning: Experiment with different hyperparameters using the Hyperparameter Tuning Guide to optimize model performance.
  2. Data Augmentation: Implement techniques like flip, scale, rotate, and color adjustments to enhance your training dataset and improve model generalization.
  3. Transfer Learning: Leverage pre-trained models and fine-tune them on your specific dataset using the Train YOLO11 guide.
  4. 导出为高效格式:使用导出指南将模型转换为TensorRT 或ONNX 等优化格式,以加快推理速度。
  5. 基准测试利用基准模式系统地衡量和提高推理速度和准确性。

能否在移动设备和边缘设备上部署Ultralytics YOLO 模型?

是的,Ultralytics YOLO 型号专为多功能部署而设计,包括移动和边缘设备:

  • 移动:将模型转换为 TFLite 或CoreML ,以便无缝集成到Android 或iOS 应用程序中。有关特定平台的说明,请参阅《TFLite 集成指南》和《CoreML 集成指南》
  • 边缘设备:使用TensorRT 或ONNX 在NVIDIA Jetson 等设备或其他边缘硬件上优化推理。《边缘TPU 集成指南》提供了边缘部署的详细步骤。

如需全面了解各种平台的部署策略,请查阅部署选项指南

如何使用训练有素的Ultralytics YOLO 模型进行推理?

使用训练有素的Ultralytics YOLO 模型进行推理非常简单:

  1. 加载模型:
from ultralytics import YOLO

model = YOLO("path/to/your/model.pt")
  1. 运行推理:
results = model("path/to/image.jpg")

for r in results:
    print(r.boxes)  # print bounding box predictions
    print(r.masks)  # print mask predictions
    print(r.probs)  # print class probabilities

有关批处理、视频推理和自定义预处理等高级推理技术,请参阅详细的预测指南

在哪里可以找到使用Ultralytics 的示例和教程?

Ultralytics 提供丰富的资源,帮助您入门和掌握工具:

  • 📚官方文档:全面的指南、API 参考资料和最佳实践。
  • 💻GitHub 代码库:源代码、示例脚本和社区贡献。
  • ✍️Ultralytics 博客:深度文章、使用案例和技术见解。
  • 💬社区论坛:与其他用户交流、提问和分享经验。
  • 🎥YouTube 频道:有关各种Ultralytics 主题的视频教程、演示和网络研讨会。

这些资源提供了使用Ultralytics 模型执行各种任务的代码示例、实际用例和分步指南。

如果您需要进一步帮助,请随时查阅Ultralytics 文档,或通过GitHub Issues官方论坛联系社区。

📅 Created 11 months ago ✏️ Updated 20 days ago

评论