- HTMLImageElement (img タグ ) をレンダリングする .
- レンダリングした画像がロードされたら (
<img >
タグのonLoad
), HTMLImageElement オブジェクトを取得して以下の内容を関数で実行する. - HTMLImageElement を
tf.browser.fromPixels
で Tensor に変換. - model を読み込む.
/public/web_model/model.json
からモデルを取得して読み込む. - Tensor をモデルに渡して, 推論結果 (Tensor)を得る.
- 推論結果を JavaScript Array に整形する.
- 画像上に推論結果を描画する.
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.