tensorflow.js

How can tensorflow do basic math with integer data larger than 32 bits?

橙三吉。 提交于 2021-01-28 05:11:54
问题 What's the best way to do simple math using int64, BigInt or even float64 values with tensors? I mention that I want to do simple math to say that I don't think that backing the tensor with a String will do the trick (though I'm open to anything at this point). By simple math, I mean add, subtract, multiply, divide and compare. I'm a tensorflow newbie, using version 1.1.2 of tensorflow for javascript in Chrome. Here's an example of Math.PI yielding an incorrect tensor value: Math.PI; // 3

Tensorflow Node-js, TypeError: Only HTTP(S) protocols are supported

你说的曾经没有我的故事 提交于 2021-01-28 02:09:01
问题 I am trying to load a local tensorflowjs model on my Node server but am getting the error: UnhandledPromiseRejectionWarning: TypeError: Only HTTP(S) protocols are supported. This is how I am importing the Tensorflowjs packages: const tf = require('@tensorflow/tfjs'); require('@tensorflow/tfjs-node'); global.fetch = require('node-fetch') and loading the model like this: const ssd_model_path = 'file://models/ssd_model/model.json' this.model = await tf.loadLayersModel(ssd_model_path); My

formating tensorflowjs object detection executeAsync output to human reabale

梦想的初衷 提交于 2021-01-06 07:22:24
问题 I'm wondering how to format the executeAsync tensorflow object detection executeAsync methods output so it look liks this: My current output looks like this and is impossible to read just by browsing through: I have been browsing through the coco-ssd.js, but for some reason it is written terribly. https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd of course this needs to be beautified, but after that, there is almost not a single variable called by its name, its basically the all

formating tensorflowjs object detection executeAsync output to human reabale

China☆狼群 提交于 2021-01-06 07:20:34
问题 I'm wondering how to format the executeAsync tensorflow object detection executeAsync methods output so it look liks this: My current output looks like this and is impossible to read just by browsing through: I have been browsing through the coco-ssd.js, but for some reason it is written terribly. https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd of course this needs to be beautified, but after that, there is almost not a single variable called by its name, its basically the all

Tensorflow-node not recognized with cocoSsd on node.js

﹥>﹥吖頭↗ 提交于 2021-01-05 13:16:07
问题 I'm using @tensorflow-models/coco-ssd and @tensorflow/tfjs-node to do some object detection. It's working, but apparently could be faster. It's honestly not even that slow, it bangs through an image in about a second or two, but it just bugs me when something isn't working as well as it could. You can find a live version of this at https://01014.org/wall-of-cats Most current code at https://github.com/qozle/wall-of-cats I get this on the first call to the model.detect(): =====================

How to train a model in nodejs (tensorflow.js)?

青春壹個敷衍的年華 提交于 2020-12-29 02:36:49
问题 I want to make a image classifier, but I don't know python. Tensorflow.js works with javascript, which I am familiar with. Can models be trained with it and what would be the steps to do so? Frankly I have no clue where to start. The only thing I figured out is how to load "mobilenet", which apparently is a set of pre-trained models, and classify images with it: const tf = require('@tensorflow/tfjs'), mobilenet = require('@tensorflow-models/mobilenet'), tfnode = require('@tensorflow/tfjs-node

How to train a model in nodejs (tensorflow.js)?

两盒软妹~` 提交于 2020-12-29 02:36:41
问题 I want to make a image classifier, but I don't know python. Tensorflow.js works with javascript, which I am familiar with. Can models be trained with it and what would be the steps to do so? Frankly I have no clue where to start. The only thing I figured out is how to load "mobilenet", which apparently is a set of pre-trained models, and classify images with it: const tf = require('@tensorflow/tfjs'), mobilenet = require('@tensorflow-models/mobilenet'), tfnode = require('@tensorflow/tfjs-node

通过AI,领略皮影戏艺术 | MixLab人工智能

ぐ巨炮叔叔 提交于 2020-12-19 07:30:33
Shadow_Art 一场颇具艺术风格的实验 这是一项 AI 实验,旨在颂扬中国古老的 皮影戏艺术 。 实验利用 TensorFlow.js,在互动游戏中将用户的手影转换成数字动物。 您可通过在笔记本电脑或手机摄像头前摆弄 “手型” ,形成十二生肖动物的手影。如果手影正确匹配,系统便会将手影转换成 相应动物 的动画影象。 技术上: 为了在浏览器上获取手部轮廓,会使用 OpenCV.js 通过摄像头从HTML5的<video> 标签捕捉出用户的手部图像,并对这些图像进行单独处理。 针对每张图像进行简单的 背景去除 ,以将前景对象(包括手和部分杂乱的背景)与背景对象进行分离。 在进行去除校准时,程序会从摄像头中不断采集图像,以 更新最新的背景对象 ,进而进一步对手势图像执行精细化的抠图操作。 执行完上述操作后,会处理裁剪出的手部图像进行 清除噪音 (包括轮廓归一化和重新采样),然后再 将图像填充为阴影 重新绘制到前端展示。 就这样,一组好玩儿又带有童趣的皮影戏就做好拉。 来一起体验下? - END - 对文中的 工具 感兴趣的小伙伴 公众号后台回复 “皮影” 即可使用 想要获得Github地址 请私聊小编 本文分享自微信公众号 - 无界社区mixlab(mix-lab)。 如有侵权,请联系 support@oschina.cn 删除。 本文参与“ OSC源创计划 ”

Backpropagation in an Tensorflow.js Neural Network

天涯浪子 提交于 2020-12-12 15:33:05
问题 When I have been attempting to implement this function tf.train.stg(learningRate).minimize(loss) into my code in order to conduct back-propagation. I have been getting multiple errors such The f passed in variableGrads(f) must be a function . How would I implement the function above into the code bellow successfully? and Why does this error even occur? Neural Network: var X = tf.tensor([[1,2,3], [4,5,6], [7,8,9], [10,11,12]]) var Y = tf.tensor([[0,0,0],[0,0,0], [1,1,1]]) var m = X.shape[0]

Unknown regularizer: L2 in tensorflowjs

拟墨画扇 提交于 2020-12-12 10:54:34
问题 I have trained a model in python using model reg = 0.000001 model = Sequential() model.add(Dense(24, activation='tanh', name='input_dense', input_shape=input_shape)) model.add(GRU(24, activation='tanh', recurrent_activation='sigmoid', return_sequences=True, kernel_regularizer=regularizers.l2(reg), recurrent_regularizer=regularizers.l2(reg), reset_after=False)) model.add(Flatten()) model.add(Dense(2, activation='softmax')) But when I converted this model using "tensorflowjs_converter --input