$ show kadirnar/segment-anything-video
MetaSeg is a Python library that packages Facebook's Segment Anything Model (SAM) into an easy-to-use interface for automatic and manual image/video segmentation. It provides high-level predictors (SegAutoMaskPredictor, SegManualMaskPredictor) that handle model loading, inference, and output visualization. The library integrates with SAHI for sliced inference and FalAI for cloud GPU execution, and includes a Gradio web application. The codebase is primarily a thin orchestration layer over the official SAM implementation, with additional utility functions for data loading, video processing, and model download. It is designed for developers who want to quickly apply SAM without deep model internals.
The LLM identified 1 files worth highlighting for reuse:
Provides the ResizeLongestSide class for resizing images to a target longest side while maintaining aspect ratio, and applies corresponding scaling to point coordinates and bounding boxes. This is a self-contained, reusable utility that can be extracted for any computer vision project requiring consistent coordinate transformation across image resizing. It handles both numpy arrays and torch tensors, making it suitable for batch processing in model inference pipelines.