RepViT-SAM: Towards Real-Time Segmenting Anything

Ao Wang, Hui Chen, Zijia Lin, Jungong Han, Guiguang Ding
12/10/2023
cs.CV

Official code: THU-MIG/RepViT (1,112 stars, Apache-2.0, last commit 2024-06-14).

Abstract

Segment Anything Model (SAM) has shown impressive zero-shot transfer performance for various computer vision tasks recently. However, its heavy computation costs remain daunting for practical applications. MobileSAM proposes to replace the heavyweight image encoder in SAM with TinyViT by employing distillation, which results in a significant reduction in computational requirements. However, its deployment on resource-constrained mobile devices still encounters challenges due to the substantial memory and computational overhead caused by self-attention mechanisms. Recently, RepViT achieves the state-of-the-art performance and latency trade-off on mobile devices by incorporating efficient architectural designs of ViTs into CNNs. Here, to achieve real-time segmenting anything on mobile devices, following MobileSAM, we replace the heavyweight image encoder in SAM with RepViT model, ending up with the RepViT-SAM model. Extensive experiments show that RepViT-SAM can enjoy significantly better zero-shot transfer capability than MobileSAM, along with nearly $10\times$ faster inference speed. The code and models are available at \url{https://github.com/THU-MIG/RepViT}.

View on arXivView PDF

Code Implementations(1)

THU-MIG/RepViTOfficial100%
Apache-2.0

RepViT: Revisiting Mobile CNN From ViT Perspective [CVPR 2024] and RepViT-SAM: Towards Real-Time Segmenting Anything

1,11283Shell, PythonJul 18, 20232 years agoApache-2.0

Cite this paper

@article{wang2023repvitsam,
  title  = {RepViT-SAM: Towards Real-Time Segmenting Anything},
  author = {Ao Wang and Hui Chen and Zijia Lin and Jungong Han and Guiguang Ding},
  year   = {2023},
  eprint = {2312.05760},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2312.05760v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2312.05760.svg)](https://codeofpaper.com/paper/2312.05760)

Discussion