Skip to main content

Extract foreground from images or video via text prompt

Project description

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

Why?

Meta's Segment Anything is a powerful tool for separating parts of images, but requires coordinate prompts—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, 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.

How does it work?

The foreground is selected using text prompts to GroundingDINO to detect objects. Image segments are generated using Segment Anything or Segment Anything HQ (SAM-HQ).

Quick start

# 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ezsam-0.3.0.tar.gz (76.0 kB view details)

Uploaded Source

Built Distribution

ezsam-0.3.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file ezsam-0.3.0.tar.gz.

File metadata

  • Download URL: ezsam-0.3.0.tar.gz
  • Upload date:
  • Size: 76.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for ezsam-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a162fc8b22586225857ef3fed4003fb504e2515c7ce84c00f064f81e93288004
MD5 eefcf538f0122a3bd2d83f878d45c786
BLAKE2b-256 202bf9ffcfc17f3c5ff5ed3e3f99e4e9d835dbbbd053ccd8d72127b09095a20a

See more details on using hashes here.

File details

Details for the file ezsam-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ezsam-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 34.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for ezsam-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa9d81d75df7b21de20cfcc5796602700203ed5c2f6755499820e30753a17e9a
MD5 e2915939b0ac1d177a9870a2268bb9a0
BLAKE2b-256 01119960cb3437b264b7d63f0b68b40ce63977364bd33b0ff3a8b861919f72bb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page