问题标签 [tfjs-node]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
63 浏览

tensorflow-lite - 使用来自 Tensorflow Lite Model Maker 的 Saved Model Format 会导致预测结果不佳

按照本教程,我使用 Tensorflow Model Maker 创建了一个简单的图像分类模型。我将导出格式从 tflite 更改为 Saved Model,因为我打算将它与 tfjs-node 一起使用,如此处所示

在 python 中使用图像测试 tflite 模型会返回非常好的结果(所需类接近 95%):

使用 Saved Model 格式的预测结果完全不同且错误:

当我将保存的模型与 tfjs-node 一起使用时,同样的问题。

1.) 你知道如何解决这个问题或者我可以在哪里看看吗?2.) 还有什么可能有帮助的:tensorflow 中是否有任何受支持的方式可以将 tflite 模型与 tfjs-node 一起使用?

我在许多其他事情中尝试过的事情:

  • 在创建模型之前将图像调整为所需大小以消除图像处理中的差异
  • 将 input_tensor 转换为 float32 没有任何区别 (tf.convert_to_tensor(input_tensor, dtype=tf.float32))
0 投票
0 回答
21 浏览

react-native - TFJS React Native giving different predictions on Android vs iOS

I'm trying to build an app that uses yolov5 (basically object detection). the inference results are the same as python when i use my samsung galaxy fold 3. however when i start using it on my iphone, the results starts becoming very random. for the same image, i got the following:

Android

but on iOS its

I found a github issue that says to do tf.ENV.set('WEBGL_PACK', false) but it did not help. apparently it's a webgl issue(?)

a snippet of my prediction function

any help would be greatly appreciated!

0 投票
1 回答
171 浏览

reactjs - ReactJS - Faceapi.js 错误:toNetInput - 预期的媒体类型问题

我是 reactjs 的新手,并构建了一个页面/组件来上传图像并通过 faceapi.js 运行它以显示面部标志点。我试图将这些点放在一个数组中,以便稍后用于其他过程。

网络摄像头版本有效,然后我尝试制作基于照片的版本;但是,一直在努力解决以下问题。

我得到的当前错误:

我也尝试从 Dom 中的图像元素定义它,但没有奏效。我觉得我错过了一些非常简单但又太盲目的东西......

任何帮助都是有价值的,在此先感谢。

以下是我经历过的可能会有所帮助的来源。 尝试使用 face-api.js 检测图像上的人脸。出现错误:未处理的拒绝(错误):createCanvasFromMedia -media 尚未完成加载

face-api.js 从磁盘加载图像文件

尝试使用 face-api.js 检测图像上的人脸。出现错误:未处理的拒绝(错误):createCanvasFromMedia -media 尚未完成加载

https://github.com/k3nnet/image_recognition/blob/master/src/app/image-component/image-component.component.ts

https://github.com/justadudewhohacks/face-api.js

https://medium.com/@kkmphele/image-facial-recognition-in-javascript-using-convolutional-neural-networks-with-face-api-js-7ce8a8c7493c