Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

t-edzuka/yolov5-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yolov5 を用いた Object detection のサンプルコード

データの流れ

  1. HTMLImageElement (img タグ ) をレンダリングする .
  2. レンダリングした画像がロードされたら (<img >タグのonLoad), HTMLImageElement オブジェクトを取得して以下の内容を関数で実行する.
  3. HTMLImageElement を tf.browser.fromPixelsで Tensor に変換.
  4. model を読み込む. /public/web_model/model.json からモデルを取得して読み込む.
  5. Tensor をモデルに渡して, 推論結果 (Tensor)を得る.
  6. 推論結果を JavaScript Array に整形する.
  7. 画像上に推論結果を描画する.