---
title: MobileSAM
canonical_url: "https://www.modelscope.cn/models/AXERA-TECH/MobileSAM"
md_url: "https://www.modelscope.cn/models/AXERA-TECH/MobileSAM.md"
repository: AXERA-TECH/MobileSAM
last_updated: 2026-07-18
license: afl-3.0
pipeline_tag: image-segmentation
tasks:
  - image-segmentation
base_model:
  - qualcomm/MobileSam
base_model_relation: finetune
library_name:
  - onnx
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 94
stars: 1
tags:
  - SAM
  - MobileSAM
  - Segmentation
---

# MobileSAM

> MobileSAM - AXERA-TECH 在 ModelScope 开源的模型。MobileSAM 基于MobileSAM的图像分割Pipeline，支持多种输入提示（框、点、掩码），支持650N/620E系列平台的模型推理。

AXERA-TECH/MobileSAM 是 ModelScope 魔搭社区上的image-segmentation模型，采用 afl-3.0 许可，基于 qualcomm/MobileSam 构建。

- **Repository**: AXERA-TECH/MobileSAM
- **License**: afl-3.0
- **Tasks**: image-segmentation
- **Base model**: qualcomm/MobileSam
- **Tags**: SAM, MobileSAM, Segmentation
- **Downloads**: 94
- **Stars**: 1
- **Last updated**: 2026-07-18

Source: https://www.modelscope.cn/models/AXERA-TECH/MobileSAM

---

# MobileSAM
基于MobileSAM的图像分割Pipeline，支持多种输入提示（框、点、掩码），支持650N/620E系列平台的模型推理。

支持芯片:
- AX650N
- AX620E
- AX630C


支持硬件

  - [M4N-Dock(爱芯派Pro)](https://wiki.sipeed.com/hardware/zh/maixIV/m4ndock/m4ndock.html)
  - [M.2 Accelerator card](https://docs.m5stack.com/zh_CN/ai_hardware/LLM-8850_Card)

原始模型请参考
- [MobileSAM Github](https://github.com/ChaoningZhang/MobileSAM)

## 性能对比

- 输入图片大小 1024x1024

|Chip| Models                | Latency (ms) | CMM Usage (MiB) |
|----| --------------------- | ---------------------- | -------------- |
|650N| mobile_sam_encoder          |49.495               | 48.334   |
|630C| mobile_sam_encoder         |520.044              | 63.231   |
|650N| mobile_sam_decoder          |9.930                | 16.703   | 
|630C| mobile_sam_decoder         |36.382               | 14.970   |

## 模型转换
- 模型转换工具链[Pulsar2](https://huggingface.co/AXERA-TECH/Pulsar2)
- 转换文档[Model Convert](https://github.com/AXERA-TECH/MobileSAM.axera/tree/master/convert)

## 环境准备
- NPU Python API: [pyaxengine](https://github.com/AXERA-TECH/pyaxengine)

安装需要的python库
```pip install -r requirements.txt```

## 运行
```shell
cd python_ax
python3 main.py -i ../images/test.jpg -c 650
```
output:
![point](./images/point_mask_ovlap_point_1.jpg)
![box](./images/box_mask_ovlap_box_1.jpg)
