Detect Any Shadow: Segment Anything for Video Shadow Detection

Yonghui Wang, Wengang Zhou, Yunyao Mao, Houqiang Li
5/26/2023
cs.CV

Official code: harrytea/Detect-AnyShadow (68 stars, MIT, last commit 2024-11-28).

Abstract

Segment anything model (SAM) has achieved great success in the field of natural image segmentation. Nevertheless, SAM tends to consider shadows as background and therefore does not perform segmentation on them. In this paper, we propose ShadowSAM, a simple yet effective framework for fine-tuning SAM to detect shadows. Besides, by combining it with long short-term attention mechanism, we extend its capability for efficient video shadow detection. Specifically, we first fine-tune SAM on ViSha training dataset by utilizing the bounding boxes obtained from the ground truth shadow mask. Then during the inference stage, we simulate user interaction by providing bounding boxes to detect a specific frame (e.g., the first frame). Subsequently, using the detected shadow mask as a prior, we employ a long short-term network to learn spatial correlations between distant frames and temporal consistency between adjacent frames, thereby achieving precise shadow information propagation across video frames. Extensive experimental results demonstrate the effectiveness of our method, with notable margin over the state-of-the-art approaches in terms of MAE and IoU metrics. Moreover, our method exhibits accelerated inference speed compared to previous video shadow detection approaches, validating the effectiveness and efficiency of our method. The source code is now publicly available at https://github.com/harrytea/Detect-AnyShadow.

View on arXivView PDF

Code Implementations(1)

MIT

Official PyTorch implementation for TCSVT 23 "Detect Any Shadow: Segment Anything for Video Shadow Detection"

686PythonMay 26, 20231 years agoMIT

Similar Papers

Cite this paper

@article{wang2023detect,
  title  = {Detect Any Shadow: Segment Anything for Video Shadow Detection},
  author = {Yonghui Wang and Wengang Zhou and Yunyao Mao and Houqiang Li},
  year   = {2023},
  eprint = {2305.16698},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.16698v2}
}

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/2305.16698.svg)](https://codeofpaper.com/paper/2305.16698)

Discussion