用tensorflow.js把手写字识别项目部署到网上(一)
2020-06-03 05:03
295 查看
需要的知识
深度学习,tensorflow训练过程,javascript相关知识
需要的平台支持
Chrome浏览器,Web Server for Chrome,一个编辑HTML的工具(我用的是VS code)
一,
在电脑某盘新建文件夹Examples作为项目,用VScode打开项目,新建三个文件,分别为mnist.html, data.js, script.js
其中mnist.html如下,作为呈现页面,包括,两个按钮和一个放置图片的画布。
<html> <head> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@latest"></script> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis"></script> </head> <body> <h1>Handwriting Classifier!</h1> <canvas id="canvas" width="280" height="280" style="position:absolute;top:100;left:100;border:8px solid;"></canvas> <img id="canvasimg" style="position:absolute;top:10%;left:52%;width=280;height=280;display:none;"> <input type="button" value="classify" id="sb" size="48" style="position:absolute;top:400;left:100;"> <input type="button" value="clear" id="cb" size="23" style="position:absolute;top:400;left:180;"> <script src="data.js" type="module"></script> <script src="script.js" type="module"></script> </body> </html>
第二个文件data.js的功能包括下载训练手写字数据,打包处理,
相关文章推荐
- 用tensorflow.js把手写字识别项目部署到网上(四)
- 用tensorflow.js把手写字识别项目部署到网上(三)
- 用tensorflow.js把手写字识别项目部署到网上(二)
- Android+TensorFlow+CNN+MNIST 手写数字识别实现
- TensorFlow MNIST 手写数字识别之过拟合
- 网上商城项目,前后端分离,springboot+vue.js,有线上部署教程
- 一个简单的TensorFlow.js的猫狗识别样例
- TensorFlow MNIST手写数字识别学习笔记(二)
- MNIST-手写数字识别-TensorFlow&&Pytorch
- TensorFlow—mnist手写识别
- TensorFlow在MNIST中的应用 识别手写数字(OpenCV+TensorFlow+CNN)
- [置顶] 【tensorflow CNN】构建cnn网络,识别mnist手写数字识别
- Tensorflow MNIST 手写识别
- Android+TensorFlow+CNN+MNIST 手写数字识别实现
- python tensorflow 使用minist数据集实现手写数字识别
- TensorFlow MNIST手写数字识别学习笔记(一)
- TensorFlow CNN 以库函数的方式实现MNIST手写识别
- 在浏览器中进行深度学习:TensorFlow.js (四)用基本模型对MNIST数据进行识别
- 100天搞定机器学习|day39 Tensorflow Keras手写数字识别
- Android+TensorFlow+CNN+MNIST实现手写数字识别