手機即時影像辨識APP:使用TensorFlow.js和React

栏目: IOS · Android · 发布时间: 6年前

安裝

npx create-react-app obj-detector
cd obj-detector
npm install @tensorflow/tfjs @tensorflow-models/coco-ssd

程式

// 到"obj-detector/src/"資料夾 
// 開啟App.js,將程式碼更換為下方網址內的內容
<a href="https://gist.githubusercontent.com/Jackie-Tan/edfcdbd62e8b4974b3856d968e1e53a1/raw/bad6e0a35006711c5e89a151ee962824385a3ab4/App.js" rel="nofollow noopener noreferrer" target="_blank">https://gist.githubusercontent.com/Jackie-Tan/edfcdbd62e8b4974b3856d968e1e53a1/raw/bad6e0a35006711c5e89a151ee962824385a3ab4/App.js</a>
<strong>/*更換App.css的內容如下*/</strong>
.app-position {
 position: fixed;
 margin: auto;
}

佈署

npm start
#開啟以下網址查看APP
<a href="http://localhost:3000/" rel="nofollow noopener noreferrer" target="_blank">http://localhost:3000/</a>

在手機上開

#開啟ngrok.exe後,輸入下方指令後會產生一串網址,將該網址於手機上開啟即可
#手機須使用Chrome開啟
ngrok http 3000

以上所述就是小编给大家介绍的《手機即時影像辨識APP:使用TensorFlow.js和React》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Little MLer

The Little MLer

Matthias Felleisen、Daniel P. Friedman、Duane Bibby、Robin Milner / The MIT Press / 1998-2-19 / USD 34.00

The book, written in the style of The Little Schemer, introduces instructors, students, and practicioners to type-directed functional programming. It covers basic types, quickly moves into datatypes, ......一起来看看 《The Little MLer》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具