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

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

安裝

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》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

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

Beginning ARKit for iPhone and iPad

Beginning ARKit for iPhone and iPad

Wallace Wang / Apress / 2018-11-5 / USD 39.99

Explore how to use ARKit to create iOS apps and learn the basics of augmented reality while diving into ARKit specific topics. This book reveals how augmented reality allows you to view the screen on ......一起来看看 《Beginning ARKit for iPhone and iPad》 这本书的介绍吧!

SHA 加密
SHA 加密

SHA 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器