Skip to content

Kazuhito00/MobileSAM-ONNX-Sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MobileSAM-ONNX-Sample

ChaoningZhang/MobileSAM のエンコーダー/デコーダーをONNXに変換し、推論するサンプルです。
推論スクリプトは、前処理、後処理を含めPyTorch依存の処理は使用しない方針です。

Demo.mp4

Usage

ONNX変換、推論テスト

Open In Colab
Colaboratoryでノートブックを開き、上から順に実行してください。

簡易デモ

以下コマンドでデモを起動してください。
左クリックでプロンプト座標を追加、右クリックでプロンプト座標を削除します。
また、キーボード1~3で、クリック時に追加する座標のタイプを変更します(1:対象座標、2:非対象座標、3:対象バウンディングボックス)

python demo.py
  • --image
    画像ファイルの指定
    デフォルト:sample.png
  • --encoder
    エンコーダーONNXファイルのパス
    デフォルト:onnx_model/vit_t_encoder.onnx
  • --decoder
    デコーダーONNXファイルのパス
    デフォルト:onnx_model/vit_t_decoder.onnx

Note

サンプルの画像はぱくたそ様の「トゲトゲのサボテンとハリネズミ」を使用しています。

License

MobileSAM-ONNX-Sample is under Apache-2.0 license.

Author

高橋かずひと(https://twitter.com/KzhtTkhs)

About

MobileSAM のエンコーダー/デコーダーをONNXに変換し、推論するサンプル

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published