# sam2-playground
Gradio based Playground Web UI using [facebook/segment-anything-2](https://github.com/facebookresearch/segment-anything-2) models.
## Online Demos
## Feature
- Add filters to segment parts of a video with pixelated or solid color
- Divide segmentation parts into layers and save them as PSD files.
Divide clothes into layers and save as PSD file |
|
See PROMPT_GUIDE.md to see how to prompt the segmentation parts of the image.
# Installation and Running
### Prerequisites
To run this Web UI, you need these prerequisites. If you don't have them, please install them in the following links :
- `git` : https://git-scm.com/downloads
- `python=>3.10` : https://www.python.org/downloads/
- `FFmpeg` : https://ffmpeg.org/download.html
After installing FFmpeg, **make sure to add the `FFmpeg/bin` folder to your system PATH!**
And for CUDA, if you're not using an Nvidia GPU and CUDA 12.4, edit the [requirements.txt](https://github.com/jhj0517/sam2-playground/blob/master/requirements.txt) to match your environment.
### Running with Shell / Batch Scripts
There's a set of shell / batch scripts for installation and running.
1. Download `sam2-playground.zip` with the file corresponding to your OS from [sam2-playground-portable.zip]() and extract its contents.
2. Run `install.bat` or `install.sh` to install dependencies. (This will create a `venv` directory and install dependencies there.)
3. Start WebUI with `start-webui.bat` or `start-webui.sh`
4. To update the WebUI, run `update.bat` or `update.sh`
### Docker
## Todo
- [ ] Support `change()` API for `gradio_image_prompter` and automatically generate preview for video predictor