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

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

安裝

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

查看所有标签

猜你喜欢:

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

Boolean Reasoning

Boolean Reasoning

Brown, Frank Markham / 2003-4 / $ 19.15

A systematic treatment of Boolean reasoning, this concise, newly revised edition combines the works of early logicians with recent investigations, including previously unpublished research results. Th......一起来看看 《Boolean Reasoning》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

在线进制转换器
在线进制转换器

各进制数互转换器

SHA 加密
SHA 加密

SHA 加密工具