Skip to content

Segment Anything (SAM) at Home web app using Gradio

Notifications You must be signed in to change notification settings

imadtoubal/sam-home

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segment Anything at Home

This project is fork of Segment Anything WebUI which uses Segment Anything Model by Meta. The UI is based on Gradio.

sam-home-demo-screenshot

Changes from the original version

  • No bells and whistles: this version is stripped from video segmentation and text prompt segmentation. Focusing only on click-based interactive segmentation.
  • Performance improvements: faster use of SAM predictor using these tricks:
    • The model is loaded only ONCE per session reducing unnecessary I/O (this reduces annotation latency by ~2x.)
    • SAM embeddings are calculated only ONCE per image (this reduces annotation latency by ~10x.)
  • Cleaner codebase: the codebase is simplified and cleaned up. The codebase is also made more modular and easier to understand.

Usage

Following usage is running on your computer.

  • Install Segment Anything(more details about install Segment Anything:

    $ pip install git+https://github.com/facebookresearch/segment-anything.git
  • git clone this repository:

    $ git clone https://github.com/imadtoubal/sam-home.git
    $ cd sam-home
  • Make a new folder named checkpoints under this project,and put the downloaded weights files in checkpoints。You can download the weights using following URLs:

  • Run:

    python app.py
    

Note: Default model is vit_b,the demo can run on CPU. Default device is cpu

Reference

About

Segment Anything (SAM) at Home web app using Gradio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages