我正在尝试学习如何在Android上使用一些ML的东西。我让工作了,而且似乎工作得很好。于是我试着创建我自己的模型。
我用来创建我自己的模型的代码是:
import numpy as np
import os
from tflite_model_maker import model_spec
from tflite_model_maker import text_classifier
from tflite_model_maker.config import ExportFormat
from tflite_model_maker.text_classifier import Average
我训练了一个阶级识别的模型。我用fizyr的Keras训练:。
我以优异的成绩完成了训练。我的目标是将所获得的模型集成到android中。
我尝试使用以下脚本来转换模型:
import tensorflow as tf
from keras_retinanet.models import load_model
from keras.layers import Input
from keras.models import Model
if __name__ == "__main__":
model = load_model("modelFINAL.h5")
我想在我的Xamarin Android应用程序上加载一个.tflite模型。 我试过用TensorFlow Interpreter加载它 var file = new Java.IO.File("C:\\Users\\Jaime\\source\\repos\\IdentificadorImagenesSolution\\IdentificadorImagenes\\IdentificadorImagenes.Android\\Assets\\detect.tflite");
var model = new Xamarin.TensorFlow.Lite.Interpret
我正在创建一个用于运行谷歌眼镜企业版2的android应用程序,它可以实时识别人脸。我使用相机X作为我的相机API和TensorFlow Lite (TFLite)作为我的分类模型。但是,TFLite模型输入需要ByteBuffer,而我无法从从CameraX检索的图像中转换为该输入。
如何将图像从CameraX转换为ByteBuffer类以供TFLite模型使用?
相机X图像分析:
val imageAnalysis = ImageAnalysis.Builder()
.setTargetResolution(Size(640
我想使用TensorFlowLite (和Kotlin)在安卓上运行一个自定义的tflite模型。尽管我使用TFLite支持库创建了一个格式正确的输入和输出缓冲区,但每次调用run()方法时,我都会收到以下错误消息。 下面是我的类: class Inference(context: Context) {
private val tag = "Inference"
private var interpreter: Interpreter
private var inputBuffer: TensorBuffer
private var outpu