【发布时间】:2017-09-05 14:58:13
【问题描述】:
您能否推荐一个库(或 sn-p)来在 Android API 18 上实现预处理 Python 方法(例如 numpy.expand_dims() 或 img_to_array)(以部署基于 TensorFlow Mobile 的应用程序)? Java 上有与 Python 类似的库(例如 ND4J),但它们需要运行 API 级别 21 或更高级别的设备或模拟器。
from keras.preprocessing.image import img_to_array
import numpy as np
image = img_to_array(image)
image = np.expand_dims(image, axis=0)
image /= 255.
【问题讨论】:
-
函数文档页面有源代码链接。
标签: python tensorflow keras dl4j nd4j