原做者: Amit Shekharandroid
連接: https://afteracademy.com/blog/android-tensorflow-lite-machine-learning-examplegit
利用TensorFlow Lite庫進行目標檢測
TensorFlow Lite是TensorFlow針對移動設備的輕量級解決方案。 TensorFlow Lite優勢:github
- TensorFlow Lite支持低延遲的設備上機器學習推斷。所以速度很快。
- TensorFlow Lite採用較小的二進制大小。所以適合移動設備。
- TensorFlow Lite還支持Android神經網絡API的硬件加速。
TensorFlow Lite使用許多技術來實現低延遲,例如:網絡
- 爲移動應用程序優化內核。
- 預融合激活。
- 容許更小更快(定點數學)模型的量化內核。
如何在Android應用程序中使用TensorFlow Lite?
使用TensorFlow Lite時最重要的技巧是準備不一樣於常規TensorFlow模型的模型(.tflite)。 爲了使用TensorFlow Lite運行模型,必須將模型轉換爲TensorFlow Lite接受的模型(.tflite)。從這裏開始按步驟走。 如今,您將擁有模型(.tflite)和標籤文件。您能夠開始在Android應用程序中使用這些模型和標籤文件來加載模型,並使用TensorFlow Lite庫預測輸出。 我已經建立了一個完整的運行示例應用程序,使用TensorFlow Lite進行對象檢測。在這裏查看項目 Credit:分類器示例取自Google TensorFlow示例。機器學習
示例應用程序-對象檢測示例 Object Detectionide
PS:我是黑胡桃實驗室社區的一名成員,最近常常在看一些老外作的有趣的人工智能項目,若是有興趣或疑問能夠在評論區留言或私信與我交流^μ^優化