Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cmarschner committed Nov 4, 2023
1 parent 28c8bf5 commit 4c1bf9e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,21 @@ python scripts/export_onnx_model.py --checkpoint ./weights/mobile_sam.pt --model
Also check the [example notebook](https://github.com/ChaoningZhang/MobileSAM/blob/master/notebooks/onnx_model_example.ipynb) to follow detailed steps.
We recommend to use `onnx==1.12.0` and `onnxruntime==1.13.1` which is tested.

## Pytorch Mobile Export

**MobileSAM** can now be run on Pytorch Mobile. Export the model with

```
python ./scripts/convert_pytorch_mobile.py output_dir
```

The result can be loaded as described in https://pytorch.org/tutorials/prototype/ios_gpu_workflow.html

BUT: The current version only runs on CPU on Pytorch Mobile. The metal backend is missing strided convolution as it seems.

The caller still needs to provide input scaling and normalization, as it is done in
[set_image()](https://github.com/ChaoningZhang/MobileSAM/blob/master/mobile_sam/predictor.py) in the predictor example.


## BibTex of our MobileSAM
If you use MobileSAM in your research, please use the following BibTeX entry. :mega: Thank you!
Expand Down

0 comments on commit 4c1bf9e

Please sign in to comment.