Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ from pathlib import Path
|
|
6 |
os.system("git clone https://github.com/AK391/TokenCut.git")
|
7 |
os.chdir("TokenCut")
|
8 |
|
9 |
-
os.system("wget https://
|
10 |
|
11 |
def inference(img):
|
12 |
os.system("python main_tokencut.py --image_path "+img+" --visualize all")
|
@@ -18,5 +18,5 @@ description="Gradio demo for TokenCut: Self-Supervised Transformers for Unsuperv
|
|
18 |
|
19 |
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>"
|
20 |
|
21 |
-
examples=[['
|
22 |
gr.Interface(inference,gr.inputs.Image(type="filepath"),[gr.outputs.Image(type="file",label="TokenCut_attn"),gr.outputs.Image(type="file",label="TokenCut_predication")],title=title,description=description,article=article,examples=examples).launch(enable_queue=True)
|
|
|
6 |
os.system("git clone https://github.com/AK391/TokenCut.git")
|
7 |
os.chdir("TokenCut")
|
8 |
|
9 |
+
os.system("wget https://images.pexels.com/photos/1170986/pexels-photo-1170986.jpeg -O cat.jpg")
|
10 |
|
11 |
def inference(img):
|
12 |
os.system("python main_tokencut.py --image_path "+img+" --visualize all")
|
|
|
18 |
|
19 |
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>"
|
20 |
|
21 |
+
examples=[['cat.jpeg']]
|
22 |
gr.Interface(inference,gr.inputs.Image(type="filepath"),[gr.outputs.Image(type="file",label="TokenCut_attn"),gr.outputs.Image(type="file",label="TokenCut_predication")],title=title,description=description,article=article,examples=examples).launch(enable_queue=True)
|