yangtaowang
commited on
Commit
•
8aa2bcc
1
Parent(s):
f0e9ffa
Update app.py
Browse files
app.py
CHANGED
@@ -8,12 +8,12 @@ os.chdir("TokenCut")
|
|
8 |
os.system("wget https://raw.githubusercontent.com/YangtaoWANG95/TokenCut/master/examples/VOC07_000064.jpg -O parrot.jpg")
|
9 |
|
10 |
def inference(img):
|
11 |
-
os.system("python main_tokencut.py --image_path "+img+" --visualize all --resize
|
12 |
filename = Path(img).stem
|
13 |
return "./outputs/TokenCut-vit_small16_k/"+filename+"_TokenCut_attn.jpg","./outputs/TokenCut-vit_small16_k/"+filename+"_TokenCut_pred.jpg"
|
14 |
|
15 |
title="TokenCut"
|
16 |
-
description="Gradio demo for TokenCut: Self-Supervised Transformers for Unsupervised Object Discovery using Normalized Cut. To use it, simply upload your image or click on one of the examples to load them. We resize the smaller edge of the image to
|
17 |
|
18 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2202.11539' target='_blank'>Self-Supervised Transformers for Unsupervised Object Discovery using Normalized Cut</a> | <a href='https://github.com/YangtaoWANG95/TokenCut' target='_blank'>Github Repo</a></p>"
|
19 |
|
|
|
8 |
os.system("wget https://raw.githubusercontent.com/YangtaoWANG95/TokenCut/master/examples/VOC07_000064.jpg -O parrot.jpg")
|
9 |
|
10 |
def inference(img):
|
11 |
+
os.system("python main_tokencut.py --image_path "+img+" --visualize all --resize 320")
|
12 |
filename = Path(img).stem
|
13 |
return "./outputs/TokenCut-vit_small16_k/"+filename+"_TokenCut_attn.jpg","./outputs/TokenCut-vit_small16_k/"+filename+"_TokenCut_pred.jpg"
|
14 |
|
15 |
title="TokenCut"
|
16 |
+
description="Gradio demo for TokenCut: Self-Supervised Transformers for Unsupervised Object Discovery using Normalized Cut. To use it, simply upload your image or click on one of the examples to load them. We resize the smaller edge of the image to 320 to accelerate inference time. Read more at the links below"
|
17 |
|
18 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2202.11539' target='_blank'>Self-Supervised Transformers for Unsupervised Object Discovery using Normalized Cut</a> | <a href='https://github.com/YangtaoWANG95/TokenCut' target='_blank'>Github Repo</a></p>"
|
19 |
|