The dependencies can be installed by running the following command:
pip install -r requirements.txt
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
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