tensorflow.js:02.lobeで出力したモデルでpredict
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン次のリビジョン両方とも次のリビジョン | ||
tensorflow.js:02.lobeで出力したモデルでpredict [2021/01/09] – [ソースコード] adash333 | tensorflow.js:02.lobeで出力したモデルでpredict [2021/08/20] – [lobeの使い方 202108] adash333 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== | + | ====== |
[[tensorflow.js: | [[tensorflow.js: | ||
行 6: | 行 6: | ||
https:// | https:// | ||
- | ===== 流れ ===== | + | ===== 流れ |
[[https:// | [[https:// | ||
行 20: | 行 20: | ||
→ 2021年1月時点で、上記ではエラー | → 2021年1月時点で、上記ではエラー | ||
+ | |||
+ | ===== 流れ その2 ===== | ||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | -Lobeで出力したTensorFlow.js用のモデルのファイル群をGitHub Pagesで公開(デフォルトでCORS設定されている) | ||
+ | - | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | async function main(imgPath: | ||
+ | |||
+ | // run the prediction | ||
+ | const results = model.predict(decodedImage); | ||
+ | console.log(results); | ||
+ | | ||
+ | |||
+ | | ||
+ | |||
+ | } | ||
+ | |||
+ | |||
+ | const imgPath = " | ||
+ | main(imgPath); | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== TensorFlow.jsでpredict ===== | ===== TensorFlow.jsでpredict ===== | ||
+ | |||
+ | https:// | ||
+ | Microsoft Lobeが便利!写真の分類を簡単に可能。あなたのサイトにもAI導入 | ||
+ | 2021年2月26日 | ||
+ | 2021年2月28日 | ||
+ | |||
+ | |||
+ | |||
https:// | https:// | ||
行 155: | 行 217: | ||
https:// | https:// | ||
+ | ===== tfjsExample.tsを読んでみる ===== | ||
- | ===== スマホアプリSpck editor ===== | + | https:// |
- | https:// | ||
+ | https:// | ||
+ | コマンドライン引数を処理する | ||
+ | < | ||
+ | const args = process.argv.slice(2); | ||
+ | </ | ||
+ | process.argvは、文字列の配列。1番目と2番目の要素は常にnodeコマンドと実行されたスクリプトのファイルパスになる。アプリケーションがコマンドライン引数として使うのは、3番目以降の要素となる。 | ||
+ | process.argv配列を使えばコマンドライン引数を取得できる。 | ||
+ | slice()関数 | ||
+ | →文字列または配列の一部分だけ取り出すメソッド。 | ||
+ | →(配列).slice(2) で、配列の3番目以降を取り出すことになる。 | ||
+ | https:// | ||
+ | 【JavaScript入門】sliceで文字列や配列(Array)を切り抜く方法まとめ | ||
+ | 2019/4/25 | ||
+ | |||
+ | |||
+ | |||
+ | ===== スマホアプリSpck editor ===== | ||
+ | |||
+ | https:// | ||
tensorflow.js/02.lobeで出力したモデルでpredict.txt · 最終更新: 2021/08/20 by adash333