tensorflow.js

厌倦了大众字体?你可以用这个项目自创一款手写体

与世无争的帅哥 提交于 2020-08-11 23:42:47
  机器之心报道    参与:Racoon X、Jamin    这个酷炫的手写体生成项目,网页版使用 TensorFlow.js 实现,模型仅 10M。   本文主要介绍用 Tensorflow 编写的 RNN 手写笔迹合成项目,该模型主要基于 2013 年一篇关于手写笔迹合成的论文。从项目作者的 Github 进程来看,该项目实现已于 2018 年就完成,近日新推出的 Demo 所演示的交互模式下的网页版本为最新版,基于 TensorFlow.js 实现。   项目作者也表示在基于 2013 的手写笔迹合成的论文下,新增了一个推理模型进行优化。(Demo 如下图所示)      不同字体的手写笔迹合成。      项目地址:https://github.com/sjvasquez/handwriting-synthesis   网页版 Demo:https://seanvasquez.com/handwriting-generation/      上图这个权游里瑟曦的经典台词就是使用该项目创建的。    效果展示   让我们先来看一看这个项目的实际效果如何。   示例一为使用固定风格与偏置生成的样本(Smash Mouth – All Star 歌词):      示例二为使用变化的风格与固定偏置生成的样本,每一句诗词使用不同的风格生成(Vanessa Carlton – A

使用Docker和TensorFlow Serving部署服务

╄→尐↘猪︶ㄣ 提交于 2020-08-09 15:42:24
目录 1.启动docker 2.模型由来 3.部署模型 1) 拉取镜像 2)启动服务 3)查看模型状态 4)查看模型的输入输出 4.模型接口预测:REST 1.启动docker 安装详细介绍可参考: https://blog.csdn.net/weixin_42530066/article/details/107850996 2.模型由来 此处使用已训练好的model,需注意TensorFlow Serving是使用SavedModel格式来保存模型的。由于SavedModel包含了完整的TensorFlow程序,包括权重和计算,它不需要运行原始的模型构建代码,因此对共享或部署 使 用TFLite,TensorFlow .js ,T ensorFLow Serving 或者 TensorFlow Hub 很有用 注:关于SavedModel可参考: https://www.tensorflow.org/guide/saved_model ,此处不详细介绍 文件目录树如下: └─exported_model └─saved_model └─1 └─savedmodel.pb 3.部署模型 获取官网的tfserving,参考链接,链接中有详细的docker pull命令,链接如下: https://hub.docker.com/r/tensorflow/serving/tags 1)

厌倦了大众字体?你可以用这个项目自创一款手写体

梦想与她 提交于 2020-08-08 15:59:31
这个酷炫的手写体生成项目,网页版使用 TensorFlow.js 实现,模型仅 10M。 机器之心报道,参与:Racoon X、Jamin。 本文主要介绍用 Tensorflow 编写的 RNN 手写笔迹合成项目,该模型主要基于 2013 年一篇关于手写笔迹合成的论文。从项目作者的 Github 进程来看,该项目实现已于 2018 年就完成,近日新推出的 Demo 所演示的交互模式下的网页版本为最新版,基于 TensorFlow.js 实现。 项目作者也表示在基于 2013 的手写笔迹合成的论文下,新增了一个推理模型进行优化。(Demo 如下图所示) 不同字体的手写笔迹合成。 项目地址: https:// github.com/sjvasquez/ha ndwriting-synthesis 网页版 Demo: https:// seanvasquez.com/handwri ting-generation/ 上图这个权游里瑟曦的经典台词就是使用该项目创建的。 效果展示 让我们先来看一看这个项目的实际效果如何。 示例一为使用固定风格与偏置生成的样本(Smash Mouth – All Star 歌词): 示例二为使用变化的风格与固定偏置生成的样本,每一句诗词使用不同的风格生成(Vanessa Carlton – A Thousand Miles 歌词):

OpenAI GPT-2 model use with TensorFlow JS

不打扰是莪最后的温柔 提交于 2020-08-08 08:22:26
问题 Is that possible to generate texts from OpenAI GPT-2 using TensorFlowJS? If not what is the limitation, like model format or ...? 回答1: I don't see any reason as to why not, other than maybe some operation that is in gpt-2 that is not supported by tensorflowjs. I don't know how to do it, but here's a nice starting point: install.sh python3 -m pip install -q git+https://github.com/huggingface/transformers.git python3 -m pip install tensorflow tensorflowjs save.py from transformers import

OpenAI GPT-2 model use with TensorFlow JS

自古美人都是妖i 提交于 2020-08-08 08:20:52
问题 Is that possible to generate texts from OpenAI GPT-2 using TensorFlowJS? If not what is the limitation, like model format or ...? 回答1: I don't see any reason as to why not, other than maybe some operation that is in gpt-2 that is not supported by tensorflowjs. I don't know how to do it, but here's a nice starting point: install.sh python3 -m pip install -q git+https://github.com/huggingface/transformers.git python3 -m pip install tensorflow tensorflowjs save.py from transformers import

tf.browser.fromPixel(video) causes memory leak

被刻印的时光 ゝ 提交于 2020-06-27 03:53:12
问题 I wanted to get the current frame data from a video using tf.browser.fromPixels(video), but every time this function is called, there is a memory leak. TensorFlow.js version 1.3.1 Browser version Chrome Version 75.0.3770.142 Here is the code that is causing the memory leak. async function drawScreen () { console.log(tf.memory()); var frame = tf.tidy( () => { return tf.browser.fromPixels (videoElement, 3).expandDims(0).toFloat().div(tf.scalar(255)) }); console.log(tf.memory()); hr_image_0 = tf

tf.browser.fromPixel(video) causes memory leak

别等时光非礼了梦想. 提交于 2020-06-27 03:53:11
问题 I wanted to get the current frame data from a video using tf.browser.fromPixels(video), but every time this function is called, there is a memory leak. TensorFlow.js version 1.3.1 Browser version Chrome Version 75.0.3770.142 Here is the code that is causing the memory leak. async function drawScreen () { console.log(tf.memory()); var frame = tf.tidy( () => { return tf.browser.fromPixels (videoElement, 3).expandDims(0).toFloat().div(tf.scalar(255)) }); console.log(tf.memory()); hr_image_0 = tf

How to convert tensorflow.js model and weights to standard tensorflow?

*爱你&永不变心* 提交于 2020-06-25 05:19:09
问题 I want to convert a model and its respective trained weights from tensorflow.js to standard tensorflow, but cant quite figure out how to do it, the documentation of tensorflow.js dont say anything about this I have a manifest.json and a lot of other files corresponding to the weights and bias of every layer, I want to get a .bytes file, to be used in the standard version of tensorflow I checked the answers to other question that might be mildly related How to download models and weights from

Machine Learning : Tensorflow v/s Tensorflow.js v/s Brain.js [closed]

早过忘川 提交于 2020-06-24 08:02:24
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question I've recently started coding with Machine learning techniques and had been going back and forth between Machine learning implemented in different platforms. The frameworks i worked a lot with were Tensorflow (Python), Tensorflow.js and Brain.js . And i've got

[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'x.mul')]

☆樱花仙子☆ 提交于 2020-06-17 13:06:06
问题 I'm trying to get a pre-trained model loaded onto react native. When I try to run it, it gives me the error: [Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'x.mul')] Here is my code: const TensorCamera = cameraWithTensors(Camera); const modelJson = require('../../assets/model/model-fixed.json'); const modelWeights = require('../../assets/model/group1-shard1of1.bin'); class CameraCompo extends Component { constructor(props) { super(props) this.state = {