Det-SAM2:Technical Report on the Self-Prompting Segmentation Framework Based on Segment Anything Model 2
Zhiting Wang, Qiangong Zhou, Zongyang Liu
TL;DR
Det-SAM2 addresses the need for fully automated video object segmentation by removing manual prompts from SAM2 through a detection-driven prompting strategy based on YOLOv8. The framework combines a detection-driven prompt source, a SAM2-based video predictor with memory-augmented propagation, and post-processing to enable long, continuous video inference with constant memory footprints. Key contributions include: (1) automatic per-frame prompting, (2) cumulative and limited propagation strategies to reduce compute, (3) a preloadable offline Memory Bank for transfer across videos, (4) online addition of new object IDs without memory resets, and (5) GPU/CPU memory optimizations to sustain constant VRAM usage. The approach is validated with a billiards scenario, showing SAM2-level segmentation quality and practical applicability for automated decision-making in real-time streams, with potential extension to other long-video tasks.”
Abstract
Segment Anything Model 2 (SAM2) demonstrates exceptional performance in video segmentation and refinement of segmentation results. We anticipate that it can further evolve to achieve higher levels of automation for practical applications. Building upon SAM2, we conducted a series of practices that ultimately led to the development of a fully automated pipeline, termed Det-SAM2, in which object prompts are automatically generated by a detection model to facilitate inference and refinement by SAM2. This pipeline enables inference on infinitely long video streams with constant VRAM and RAM usage, all while preserving the same efficiency and accuracy as the original SAM2. This technical report focuses on the construction of the overall Det-SAM2 framework and the subsequent engineering optimization applied to SAM2. We present a case demonstrating an application built on the Det-SAM2 framework: AI refereeing in a billiards scenario, derived from our business context. The project at \url{https://github.com/motern88/Det-SAM2}.
