davisking/dlib

Feature: Android NN API usage

開放

#1,332 建立於 2018年5月26日

 (1 則留言) (0 個反應) (0 位負責人)C++ (3,442 個分叉)batch import
help wanted

倉庫指標

星標
 (14,434 顆星)
PR 合併指標
 (平均合併 3小時 56分鐘) (30 天內合併 2 個 PR)

描述

Android now has a neural network API that delegates to NPU/DSP/GPU or falls back to CPU, on devices running Android 8.1 or higher. https://developer.android.com/ndk/guides/neuralnetworks/

Ideally there would be a backend in dlib to support this framework as it is likely going to be the most optimised pathway going forwards.

NNAPI is a bit limited in what it can do at this stage. It only does int8, int32 and float32 for types and a few dozen operations.

It was expanded in NNAPI 1.1, adding some more operations [Div/Mul/Pad/Mean/Sub] (which requires Android 9.0).

Example implementation can be found in the Tensorflow Lite library: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/nnapi/NeuralNetworksShim.h

貢獻者指南