wondervictor
commited on
Commit
·
21bb142
1
Parent(s):
f06103e
update readme
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from inference import sam_preprocess, beit3_preprocess
|
3 |
from model.evf_sam import EvfSamModel
|
@@ -5,7 +6,6 @@ from transformers import AutoTokenizer
|
|
5 |
import torch
|
6 |
import numpy as np
|
7 |
import sys
|
8 |
-
import spaces
|
9 |
|
10 |
version = "YxZhang/evf-sam"
|
11 |
model_type = "ori"
|
@@ -55,6 +55,8 @@ def pred(image_np, prompt):
|
|
55 |
|
56 |
return visualization / 255.0, pred_mask.astype(np.float16)
|
57 |
|
|
|
|
|
58 |
|
59 |
demo = gr.Interface(
|
60 |
fn=pred,
|
@@ -76,7 +78,8 @@ demo = gr.Interface(
|
|
76 |
"assets/carrots.jpg",
|
77 |
"3carrots in center with ice and greenn leaves"
|
78 |
]],
|
79 |
-
title="EVF-SAM
|
|
|
80 |
allow_flagging="never")
|
81 |
# demo.launch()
|
82 |
demo.launch(share=False, server_name="0.0.0.0", server_port=10001)
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
from inference import sam_preprocess, beit3_preprocess
|
4 |
from model.evf_sam import EvfSamModel
|
|
|
6 |
import torch
|
7 |
import numpy as np
|
8 |
import sys
|
|
|
9 |
|
10 |
version = "YxZhang/evf-sam"
|
11 |
model_type = "ori"
|
|
|
55 |
|
56 |
return visualization / 255.0, pred_mask.astype(np.float16)
|
57 |
|
58 |
+
desc_title_str = '<div align ="center"><img src="assets/logo.jpg" width="20%"><h3> Early Vision-Language Fusion for Text-Prompted Segment Anything Model </h3></div>'
|
59 |
+
desc_link_str = '[![arxiv paper](https://img.shields.io/badge/arXiv-Paper-red)](https://arxiv.org/abs/2406.20076)'
|
60 |
|
61 |
demo = gr.Interface(
|
62 |
fn=pred,
|
|
|
78 |
"assets/carrots.jpg",
|
79 |
"3carrots in center with ice and greenn leaves"
|
80 |
]],
|
81 |
+
title="EVF-SAM: Referring Expression Segmentation",
|
82 |
+
description=desc_title_str + desc_link_str,
|
83 |
allow_flagging="never")
|
84 |
# demo.launch()
|
85 |
demo.launch(share=False, server_name="0.0.0.0", server_port=10001)
|