Code Monkey home page Code Monkey logo

segment_anything_webui's Introduction

Segment Anything WebUI

This project is based on Segment Anything Model by Meta. The UI is based on Gradio.

Change Logs

  • [2023-4-11]
    • Support video segmentation. A short video can be automatically segmented by SAM.
    • Support text prompt segmentation using OWL-ViT (Vision Transformer for Open-World Localization) model. Text prompt is not yet released in the current SAM version, so it is implemented indirectly using OWL-ViT.
  • [2023-4-15]
    • Support points prompt segmentation. But due to this issue, using text and point prompts together may result in an error.
    • About boxes prompt, it does not seem possible to draw the box directly in Gradio. One idea is to use two points to represent the box, but this is not accurate or elegant. Also, text prompt implements box prompt indirectly, so I won't implement box prompt directly for now. If you have any ideas about box-drawing in Gradio, please tell me.

Usage

Following usage is running on your computer.

pip install git+https://github.com/facebookresearch/segment-anything.git
  • git clone this repository:
git clone https://github.com/5663015/segment_anything_webui.git
  • 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:

  • Under checkpoints, make a new folder named models--google--owlvit-base-patch32, and put the downloaded OWL-ViT weights files in models--google--owlvit-base-patch32.

  • Run:

python app.py

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

TODO

  • Video segmentation

  • Add text prompt

  • Add points prompt

  • Add boxes prompt

  • Try to combine with ControlNet and Stable Diffusion. Use SAM to generate dataset for fine-tuning ControlNet, and generate new image with SD.

Reference

segment_anything_webui's People

Contributors

5663015 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

segment_anything_webui's Issues

hi bro, i got some error

Traceback (most recent call last):
File "D:\AI\segment-anything\segment_anything_webui\app.py", line 156, in
input_image.select(
AttributeError: 'Image' object has no attribute 'select'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.