适用于 iOS 的 开源Ultralytics YOLO:应用程序和 Swift 软件包,用于在您自己的 iOS 应用程序中运行 YOLO

​一、软件介绍

文末提供程序和源码下载

该项目利用 Ultralytics 最先进的 YOLO11 模型将您的 iOS 设备转变为用于对象检测的强大实时推理工具。直接从 App Store 下载该应用程序,或浏览我们的指南,将 YOLO 功能集成到您自己的 Swift 应用程序中。

二、Ultralytics YOLO iOS 应用程序(主应用程序)

主要的 iOS 应用程序允许使用设备的相机或图像库轻松进行实时对象检测。您只需将自定义 CoreML 模型拖放到应用程序中,即可轻松测试这些模型。

三、Swift 包(YOLO 库)

专为 iOS、iPadOS 和 macOS 设计的轻量级 Swift 软件包。它简化了基于 YOLO 的模型(如 YOLO11)在您自己的应用程序中的集成和使用。使用 SwiftUI 以最少的代码轻松集成 YOLO 模型:

复制代码
// Perform inference on a UIImage
let result = model(uiImage)
复制代码
// Use the built-in camera view for real-time detection
var body: some View {
    YOLOCamera(
        modelPathOrName: "yolo11n-seg", // Specify model name or path
        task: .segment,                // Define the task (detect, segment, classify, pose)
        cameraPosition: .back          // Choose camera (back or front)
    )
    .ignoresSafeArea()
}

四、快速入门指南

首次在移动设备上使用 YOLO 或想要快速测试您的自定义模型?从主 YOLOiOSApp 开始。

  • Ultralytics YOLO iOS App (Main App): The easiest way to experience YOLO detection on iOS.
    Ultralytics YOLO iOS 应用程序(主应用程序):在 iOS 上体验 YOLO 检测的最简单方法。

Ready to integrate YOLO into your own project? Explore the Swift Package and example applications.
准备好将 YOLO 集成到您自己的项目中了吗?探索 Swift Package 和示例应用程序。

  • Swift Package (YOLO Library): Integrate YOLO capabilities into your Swift app.
    Swift 软件包(YOLO 库):将 YOLO 功能集成到您的 Swift 应用程序中。
  • Example Apps: See practical implementations using the YOLO Swift Package.
    示例应用程序:查看使用 YOLO Swift Package 的实际实现。

五、 主要亮点

  • Real-Time Inference : Achieve high-speed, high-accuracy object detection on iPhones and iPads using optimized CoreML models, potentially enhanced through techniques like model quantization.
    实时推理:使用优化的 CoreML 模型在 iPhone 和 iPad 上实现高速、高精度的对象检测,并可能通过模型量化等技术得到增强。
  • Multi-OS Support : The Swift Package is compatible with iOS, iPadOS, and macOS, enabling broad application deployment.
    多作系统支持:Swift 套件与 iOS、iPadOS 和 macOS 兼容,支持广泛的应用程序部署。
  • Flexible Tasks : Supports object detection, with segmentation, classification, pose estimation, and oriented bounding box (OBB) detection planned for future updates.
    灵活的任务:支持对象检测,并计划在未来更新中进行分割、分类、姿势估计和定向边界框 (OBB) 检测。

🧪 Testing Procedures 🧪 测试程序

This repository includes comprehensive unit tests for both the YOLO Swift Package and the example applications, ensuring code reliability and stability.
此存储库包括针对 YOLO Swift Package 和示例应用程序的全面单元测试,确保代码的可靠性和稳定性。

Running Tests 运行测试

Tests require CoreML model files (.mlpackage), which are not included in the repository due to their size. To run the tests with model validation:
测试需要 CoreML 模型文件 ( .mlpackage ),由于大小的原因,这些文件未包含在存储库中。要使用模型验证运行测试:

  1. Set SKIP_MODEL_TESTS = false in the relevant test files (e.g., YOLOv11Tests.swift).
    在 SKIP_MODEL_TESTS = false 相关测试文件中设置(例如 YOLOv11Tests.swift )。
  2. Download the required models from the Ultralytics releases or train your own using tools like Ultralytics HUB.
    从 Ultralytics 版本下载所需的模型,或使用 Ultralytics HUB 等工具训练您自己的模型。
  3. Convert the models to CoreML format using the Ultralytics Python library's export function.
    使用 Ultralytics Python 库的导出功能将模型转换为 CoreML 格式。
  4. Add the exported .mlpackage files to your Xcode project, ensuring they are included in the test targets.
    将导出 .mlpackage 的文件添加到您的 Xcode 项目中,确保它们包含在测试目标中。
  5. Run the tests using Xcode's Test Navigator (Cmd+U).
    使用 Xcode 的 Test Navigator (Cmd+U) 运行测试。

If you don't have the model files, you can still run tests by keeping SKIP_MODEL_TESTS = true. This will skip tests that require loading and running a model.
如果您没有模型文件,您仍然可以通过保留 SKIP_MODEL_TESTS = true 来运行测试。这将跳过需要加载和运行模型的测试。

Test Coverage 测试覆盖率

  • YOLO Swift Package : Includes tests for core functionalities like model loading, preprocessing, inference, and postprocessing across different tasks.
    YOLO Swift 软件包:包括对核心功能的测试,例如跨不同任务的模型加载、预处理、推理和后处理。
  • Example Apps : Contains tests verifying UI components, model integration, and real-time inference performance within the sample applications.
    示例应用程序:包含验证示例应用程序中的 UI 组件、模型集成和实时推理性能的测试。

Test Documentation 测试文档

Each test directory (e.g., Tests/YOLOTests) may include a README.md with specific instructions for testing that component, covering:
每个测试目录(例如) Tests/YOLOTests 可能包含一个 README.md ,其中包含用于测试该组件的具体说明,包括:

  • Required model files and where to obtain them.
    所需的模型文件以及获取它们的位置。
  • Steps for model conversion and setup.
    模型转换和设置的步骤。
  • Overview of the testing strategy.
    测试策略概述。
  • Explanation of key test cases.
    关键测试用例的解释。

六、软件下载

夸克网盘分享

本文信息来源于GitHub作者地址:GitHub - ultralytics/yolo-ios-app: Ultralytics YOLO iOS App source code for running YOLO in your own iOS apps 🌟

相关推荐
网易易盾6 小时前
iOS 设备环境核验接入实践:从特征扫描到运行时完整性识别
ios
Soujer7 小时前
OpenPrint:零后端依赖的开源 Web 打印模板设计器
typescript·开源·打印设计器·web打印·静默打印
Flynt7 小时前
自托管重开实录:照 HN 419 分热帖让 AI 从零搭一遍,15 分钟踩了三个真坑
linux·开源·ai编程
Mininglamp_27187 小时前
贡献者工具链设计:从 Issue 到合并的自动化支撑
ai·开源·自动化·社区运营
wflynn7 小时前
GitHub 日榜趋势速报 | 2026-11-27
开源·github
迦蓝叶8 小时前
自建 MaaS 卡住的地方从来不是模型:JAiRouter 开源 AI 网关的四个答案
人工智能·spring boot·开源·架构设计·maas·ai 网关
FungLeo10 小时前
FengCMS · PHP+MySQL 升级实录 · 开源发布工程:GitHub Releases + SHA-256+ 三版发布说明
mysql·开源·php·fengcms
钱栈up13 小时前
GitHub 热榜上手|anthropics/skills:18.9万星的 Claude 技能库
python·开源·github
DKPT19 小时前
开源 RAG 知识库选型推荐
开源
掘金安东尼21 小时前
T3 Code 用量、口碑与同类产品:开源 Agent 控制台的头部之争
开源·ai编程·claude