glmanhtu / mobile_sam_export

Mobile SAM model exporter for onnxruntime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mobile SAM model exporter for onnxruntime

Compatibility

The dependencies can be installed by running the following command:

pip install -r requirements.txt

Export the model

Step 1: Download Mobile SAM pretrained model from https://github.com/ChaoningZhang/MobileSAM/blob/master/weights/mobile_sam.pt

Step 2: Run the script to export feature-extracting model:

python3 export_pre_model.py

Step 3: Run the script to export mask-detecting model:

python3 export_model.py

Test the exported models

Perform segmentation:

python3 predict.py

Example of using these onnxruntime models on NodeJS & Angular can be found here: https://github.com/glmanhtu/PapyrusViz/blob/dev/workspaces/electron-app/main/services/image.service.ts

About

Mobile SAM model exporter for onnxruntime


Languages

Language:Python 100.0%