File size: 1,594 Bytes
5773a3f
 
 
 
 
 
 
 
 
 
 
f98db89
 
9fbfe03
f98db89
9fbfe03
f98db89
 
 
9fbfe03
f98db89
9fbfe03
 
 
 
 
 
 
f98db89
 
 
 
 
9fbfe03
f98db89
 
 
 
 
9fbfe03
f98db89
9fbfe03
f98db89
9fbfe03
f98db89
9fbfe03
f98db89
9fbfe03
f98db89
 
 
 
 
9fbfe03
f98db89
 
 
9fbfe03
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
title: Segment Anything
emoji: 🚀
colorFrom: gray
colorTo: pink
sdk: gradio
sdk_version: 3.24.1
app_file: app.py
pinned: false
---

# Segment Anything WebUI

This project is based on **[Segment Anything Model](https://segment-anything.com/) ** by Meta. The UI is based on [Gradio](https://gradio.app/). 

- Try deme on HF: [AIBoy1993/segment_anything_webui](https://huggingface.co/spaces/AIBoy1993/segment_anything_webui)

![](./images/20230408023615.png)

## Change Logs

- [2023-4-11] Support video segmentation. 

## **Usage**

Following usage is running on your computer. 

- Install Segment Anything([more details about install Segment Anything](https://github.com/facebookresearch/segment-anything#installation)):

```
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:

  - `vit_h`: [ViT-H SAM model](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth)

  - `vit_l`: [ViT-L SAM model](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_l_0b3195.pth)

  - `vit_b`: [ViT-B SAM model](https://dl.fbaipublicfiles.com/segment_anything/sam_vit_b_01ec64.pth)

- Run:

```
python app.py
```

**Note:** Default model is `vit_b`,the demo can run on CPU. Default device is `cuda`## TODO

- Add segmentation prompt (point and box)

- Add text prompt