MogensR commited on
Commit
73fa483
Β·
1 Parent(s): 9697bbe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +35 -8
README.md CHANGED
@@ -13,14 +13,41 @@ license: mit
13
 
14
  # πŸš€ SAM2 + MatAnyone Video Background Changer
15
 
16
- This Hugging Face Space provides a powerful video background replacement tool using state-of-the-art AI models:
17
 
18
- - **Segmentation**: `Segment Anything 2 (SAM2)` for highly accurate foreground detection.
19
- - **Matting**: `MatAnyone` for professional, cinema-quality video matting.
20
 
21
- ## Key Features
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
- - **Lazy Loading**: Models are loaded into GPU memory only when needed, keeping the Space resource-efficient.
24
- - **GPU Optimization**: The Space is configured to use a T4 Small GPU for a balance of performance and availability.
25
- - **Gradio Interface**: A simple and intuitive user interface for uploading videos and background images.
26
- - **Memory Management**: After each run, models are offloaded and the GPU cache is cleared to minimize costs.
 
13
 
14
  # πŸš€ SAM2 + MatAnyone Video Background Changer
15
 
16
+ A Hugging Face Space for high-quality **video background replacement** using cutting-edge AI models:
17
 
18
+ - 🦾 **Segmentation:** [Segment Anything 2 (SAM2)](https://github.com/facebookresearch/segment-anything-2) for precise, state-of-the-art foreground detection.
19
+ - 🎬 **Matting:** [MatAnyone](https://github.com/pq-yang/MatAnyone) for cinema-quality subject/background compositing.
20
 
21
+ ---
22
+
23
+ ## ✨ Key Features
24
+
25
+ - 🎞️ **Cinema-Quality Two-Stage Processing:**
26
+ Original β†’ Green Screen β†’ Final Background, for ultra-clean edge separation and realistic results.
27
+ - πŸ–ΌοΈ **4 Background Methods:**
28
+ - πŸ“· Upload custom images
29
+ - 🎨 Use professional presets
30
+ - 🌈 Create custom gradients
31
+ - πŸ€– Generate backgrounds with AI prompts
32
+ - ⚑ **Lazy Model Loading & GPU Optimization:**
33
+ Efficient use of the T4 GPU β€” models are loaded only when needed.
34
+ - πŸ–₯️ **Intuitive Gradio Interface:**
35
+ Just upload your video, pick a background, and hit process!
36
+ - 🧹 **Automatic Memory Management:**
37
+ Models and GPU cache are cleared after each run for maximum reliability.
38
+
39
+ ---
40
+
41
+ ## βš™οΈ Configuration Notice
42
+
43
+ > **Required Model Configs:**
44
+ > This app requires one or more [SAM2 model config YAML files](https://github.com/facebookresearch/segment-anything-2/tree/main/configs) to be present in a `configs/` directory at the root of your repo.
45
+ >
46
+ > **Examples:**
47
+ > - `configs/sam2_hiera_large.yaml` (**recommended**)
48
+ > - `configs/sam2_hiera_tiny.yaml` (for CPU/fallback)
49
+ >
50
+ > If missing, download from the official SAM2 repo and add them to `configs/`.
51
+
52
+ ### πŸ“ Example Directory Structure
53