从 Google Mobile Vision 迁移
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Google Mobile Vision 已废弃,我们要求开发者迁移到其替代方案 ML Kit SDK。迁移到新 SDK 可确保您获得最佳性能、稳定性和最新功能。此外,ML Kit 还提供其他依托机器学习的 API,不仅适用于视觉用例,也适用于自然语言用例。
如果您目前在应用中使用 Mobile Vision 的条形码扫描、文本识别或人脸检测 API,请按照 适用于 Android 的机器学习套件迁移指南和 适用于 iOS 的机器学习套件迁移指南,迁移到新的机器学习套件 SDK。
常见问题解答
如何知道我的应用是否在使用移动视觉?
在 Android 上,检查您的模块(应用级)Gradle 文件(通常为 app/build.gradle
)是否包含此依赖项:
com.google.android.gms:play-services-vision:x.x.x
在 iOS 上,检查您的 Podfile 是否包含以下某个依赖项:
pod 'GoogleMobileVision/FaceDetector', '8.0.0'
pod 'GoogleMobileVision/BarcodeDetector', '8.0.0'
pod 'GoogleMobileVision/TextDetector', '8.0.0'
迁移到 ML Kit SDK 有哪些好处?
由于 Mobile Vision SDK 提供的现有 API 已废弃,因此将不再收到更新。迁移到机器学习套件可确保您的应用受益于 API 的最新 bug 修复和改进,包括更新后的机器学习模型和硬件加速。
此外,ML Kit API 还具有一些其他优势:
如需查看最新变更的完整列表,请参阅 ML Kit SDK 版本说明。
ML Kit API 是否提供与 Mobile Vision API 相同的功能?
条形码扫描、文本识别和人脸检测 API 提供与 Mobile Vision 对应 API 相同的功能。
唯一的例外情况是,ML Kit 不再支持 Mobile Vision 中的多检测器、多处理器和对焦处理器。如果需要,开发者可以相对轻松地实现相同的功能。
获取帮助
如果您遇到任何问题,请访问我们的“社区”页面,其中列出了可用于与我们联系的渠道。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-29。
[null,null,["最后更新时间 (UTC):2025-08-29。"],[[["\u003cp\u003eGoogle Mobile Vision is deprecated and developers should migrate to the ML Kit SDK for continued support and new features.\u003c/p\u003e\n"],["\u003cp\u003eML Kit offers enhanced performance, stability, and access to the latest machine learning advancements, including new APIs for Vision and Natural Language.\u003c/p\u003e\n"],["\u003cp\u003eMigration guides are available for both Android and iOS to assist developers in transitioning their apps from Mobile Vision to ML Kit.\u003c/p\u003e\n"],["\u003cp\u003eML Kit provides additional benefits like bundled variants on Android, API-specific improvements such as raw barcode output and Euler X angle in face detection, and Android Jetpack Lifecycle support for easier integration with CameraX.\u003c/p\u003e\n"]]],[],null,["Google Mobile Vision was deprecated and we are asking developers to migrate to the ML Kit SDK which is its replacement. Migrating to the new SDK ensures you get the best performance, stability and latest features. In addition, ML Kit provides additional ML-powered APIs, not only for Vision, but also Natural Language use cases.\n\nIf you are using Mobile Vision's barcode scanning, text recognition or face detection APIs in your app today, please migrate to the new ML Kit SDK, by following the\n**[ML Kit migration guide for Android](/ml-kit/mobile-vision-migration/android)** and the\n**[ML Kit migration guide for iOS](/ml-kit/mobile-vision-migration/ios)**.\n\nFrequently asked questions\n\nHow do I know if my app is using Mobile Vision?\n\nOn Android, check if your module (app-level) Gradle file (usually\n`app/build.gradle`) contains this dependency:\n\n- `com.google.android.gms:play-services-vision:x.x.x`\n\nOn iOS, check if you podfile contains one of these dependencies:\n\n- `pod 'GoogleMobileVision/FaceDetector', '8.0.0'`\n- `pod 'GoogleMobileVision/BarcodeDetector', '8.0.0'`\n- `pod 'GoogleMobileVision/TextDetector', '8.0.0'`\n\nWhat benefits do I get from migrating to the ML Kit SDK?\n\nSince the existing APIs offered by the Mobile Vision SDK are deprecated, they\nwill no longer receive updates. Migrating to ML Kit ensures your application\nbenefits from the latest bug fixes and improvements to the APIs, including\nupdated ML models and hardware acceleration.\n\nIn addition, the ML Kit APIs offer some other benefits:\n\n- New bundled variants of the APIs on Android that allow you to statically link the ML Kit SDK with your appplication.\n- API specific improvements, for example:\n\n - [Barcode Scanning API](/ml-kit/vision/barcode-scanning) now supports raw output\n - [Face Detection API](/ml-kit/vision/face-detection) now provides the Euler X angle\n- [Android Jetpack Lifecycle](https://developer.android.com/reference/androidx/lifecycle/Lifecycle)\n support is added to all APIs. You can now use `addObserver` to automatically\n manage the initiation and teardown of ML Kit APIs as the app goes through screen\n rotation or closure by the user / system. This makes integration with CameraX\n easier.\n\nA full list of the latest changes can be found in the [ML Kit SDK release\nnotes](/ml-kit/release-notes).\n\nDo the ML Kit APIs provide the same functionality as the Mobile Vision APIs?\n\nThe Barcode scanning, Text recognition and Face detection APIs provide the same\nfunctionality and capabilities as their Mobile Vision counter-parts.\n\nAn exception is that multi-detectors, multi-processors and focusing-processors in\nMobile Vision are no longer supported in ML Kit. The same functionality can be\nimplemented relatively easily by the developer if desired.\n\nGetting help\n\nIf you run into any issues, check out our [Community page](/ml-kit/community)\nwhere we outline the channels available for getting in touch with us."]]