ARCore与TFLite GPU推理同时运行时性能骤降问题求助
ARCore与TFLite GPU推理共存性能崩溃问题
我已在ARCore SDK仓库提交该问题。
遇到的具体问题
我基于Android SDK使用ARCore进行运动追踪,项目以hello_ar_kotlin示例为基础。当使用TFLite对独立图像数据进行GPU推理时,若同时运行ARCore,两者性能均会崩溃:ARCore帧率降至2-3 FPS,TFLite帧率降至1 FPS。
使用版本
- Android Studio: Iguana 2023.2.1
- ARCore SDK for Android:
com.google.ar:core:1.42.0 - 设备厂商、型号及系统:Google Pixel 7,Android 14
- Google Play Services for AR (ARCore):
versionName=1.44.241490493 signatures=PackageSignatures{c31e10a version:3, signatures:[fd17c870], past signatures:[53bcc66f flags: 17, fd17c870 flags: 17]}
adb shell getprop ro.build.fingerprint输出:
google/panther/panther:14/AP1A.240305.019.A1/11445699:user/release-keys
复现步骤
依赖配置
// for ARCore implementation("com.google.ar:core:1.42.0") implementation("de.javagl:obj:0.2.1") // for TFLite implementation("com.google.android.gms:play-services-tflite-impl:16.1.0") implementation("com.google.android.gms:play-services-tflite-java:16.1.0") implementation("com.google.android.gms:play-services-tflite-support:16.1.0") implementation("com.google.android.gms:play-services-tflite-gpu:16.2.0") implementation("com.google.android.gms:play-services-tflite-acceleration-service:16.0.0-beta01")
- 克隆
hello_ar_kotlin项目。 - 添加TFLite(Interpreter API),参考TensorFlow Lite推理相关文档。
- 同时运行ARCore与TFLite推理。
- 两者性能均会降至无法使用的水平。
现有解决方案
暂未找到。
补充说明
我无法使用MLKit结合ARCore的方案,原因如下:
- 需对来自独立设备的图像数据进行推理,无法使用ARCore提供的图像数据
- MLKit是TFLite Tasks API的轻量封装,我的使用场景不在Tasks覆盖范围内,必须使用Interpreter API
单独运行TFLite时GPU内存平均占用771 MB,与ARCore同时运行时平均占用约810 MB,增量并不大。已通过Android GPU inspector获取资源分析数据。
内容的提问来源于stack exchange,提问作者Roman Stadlhuber
相关产品推荐
相关产品推荐

