Code Monkey home page Code Monkey logo

segdrawer's Introduction

SegDrawer

Simple static web-based mask drawer, supporting semantic drawing with Segment Anything Model (SAM).

Tools

From top to bottom

  • Clear image
  • Drawer
  • SAM point-segmenter (Need backend)
  • SAM rect-segmenter (Need backend)
  • SAM Seg-Everything (Need backend)
  • Undo
  • Eraser
  • Download

After Seg-Everything, the downloaded files would include .zip file, which contains all cut-offs.

Run Locally

If don't need SAM for segmentation, just open segDrawer.html and use tools except SAM segmenter.

If use SAM segmenter, do following steps (CPU can be time-consuming)

wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth
  • Launch backend
python server.py
  • Go to Browser
http://127.0.0.1:8000

For configuring CPU/GPU and model, just change the code in server.py

sam_checkpoint = "sam_vit_l_0b3195.pth" # "sam_vit_l_0b3195.pth" or "sam_vit_h_4b8939.pth"
model_type = "vit_l" # "vit_l" or "vit_h"
device = "cuda" # "cuda" if torch.cuda.is_available() else "cpu"

Run on Colab

Follow this Colab example, or run on Colab. Need to register an ngrok account and copy your token to replace "{your_token}".

segdrawer's People

Contributors

lujiazho avatar

Stargazers

HuFeiHu avatar

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.