Metadata-Version: 2.1
Name: ezsam
Version: 0.3.0
Summary: Extract foreground from images or video via text prompt
Keywords: GroundingDINO Segment-Anything SAM SAM-HQ Grounded-Segment-Anything subject object foreground background filter extract select remove prompt subtract
Author-Email: ae9is <aegis.opensource@gmail.com>
Maintainer-Email: ae9is <aegis.opensource@gmail.com>
License: AGPL-3.0-only
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Project-URL: Homepage, https://www.ezsam.org
Project-URL: Bug reports, https://github.com/ae9is/ezsam/issues
Project-URL: Source, https://github.com/ae9is/ezsam
Requires-Python: <3.12,>=3.9
Requires-Dist: opencv-python>=4.9.0.80
Requires-Dist: numpy>=1.26.3
Requires-Dist: supervision>=0.17.1
Requires-Dist: filetype>=1.2.0
Requires-Dist: segment-anything-hq>=0.3
Requires-Dist: torch>=2.1.2
Requires-Dist: torchvision>=0.16.2
Requires-Dist: tqdm>=4.66.1
Requires-Dist: rf-groundingdino>=0.1.2
Requires-Dist: customtkinter>=5.2.2
Requires-Dist: tkinterdnd2>=0.3.0
Requires-Dist: pillow>=10.2.0
Requires-Dist: opencv-python>=4.9.0.80; extra == "cli"
Requires-Dist: numpy>=1.26.3; extra == "cli"
Requires-Dist: supervision>=0.17.1; extra == "cli"
Requires-Dist: filetype>=1.2.0; extra == "cli"
Requires-Dist: segment-anything-hq>=0.3; extra == "cli"
Requires-Dist: torch>=2.1.2; extra == "cli"
Requires-Dist: torchvision>=0.16.2; extra == "cli"
Requires-Dist: tqdm>=4.66.1; extra == "cli"
Requires-Dist: rf-groundingdino>=0.1.2; extra == "cli"
Requires-Dist: opencv-python>=4.9.0.80; extra == "gui"
Requires-Dist: numpy>=1.26.3; extra == "gui"
Requires-Dist: customtkinter>=5.2.2; extra == "gui"
Requires-Dist: tkinterdnd2>=0.3.0; extra == "gui"
Requires-Dist: pillow>=10.2.0; extra == "gui"
Provides-Extra: cli
Provides-Extra: gui
Description-Content-Type: text/markdown

# ezsam (easy segment anything model)

A command line and gui tool to segment images and video via text prompts.

Input images and videos, describe the subjects or objects you want to keep, and output new images and videos with the background removed.

**Check out the docs! [ezsam.org](https://www.ezsam.org)**

## Why?

Meta's [Segment Anything](https://github.com/facebookresearch/segment-anything) is a powerful tool for separating parts of images,
but requires coordinate prompts&mdash;either bounding boxes or points.
And manual prompt generation is tedious for large collections of still images or video.

In contrast, text-based prompts describing the object(s) in the foreground to segment can be constant.
Inspired by [Grounded-Segment-Anything](https://github.com/IDEA-Research/Grounded-Segment-Anything),
this project tries to package a simpler to use tool.

If you're not interested in text-based prompts with Segment Anything, 
check out [rembg](https://github.com/danielgatis/rembg).

## How does it work?

The foreground is selected using text prompts to [GroundingDINO](https://github.com/IDEA-Research/GroundingDINO) to detect objects.
Image segments are generated using [Segment Anything](https://github.com/facebookresearch/segment-anything) 
or [Segment Anything HQ (SAM-HQ)](https://github.com/SysCV/SAM-HQ).

## Quick start

```bash
# Ubuntu 22.04, Python 3.9 - 3.11
pip install ezsam
sudo apt install ffmpeg imagemagick
ezsam --help
ezsam-gui
```

For more detailed info, see the documentation site here: [ezsam.org](https://www.ezsam.org)
