khanrc
commited on
Commit
·
8f29e63
1
Parent(s):
0b11938
Update README & remove cache
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import os
|
2 |
import sys
|
3 |
from importlib.util import find_spec
|
@@ -40,6 +41,8 @@ model.to(device)
|
|
40 |
|
41 |
|
42 |
title = "TCL: Text-grounded Contrastive Learning"
|
|
|
|
|
43 |
description_head = """
|
44 |
<p style='text-align: center'> <a href='https://arxiv.org/abs/2212.00785' target='_blank'>Paper</a> | <a href='https://github.com/kakaobrain/tcl' target='_blank'>Code</a> </p>
|
45 |
"""
|
@@ -126,7 +129,8 @@ def inference(img, query):
|
|
126 |
|
127 |
theme = gr.themes.Soft(text_size=gr.themes.sizes.text_md, primary_hue="teal")
|
128 |
with gr.Blocks(title=title, theme=theme) as demo:
|
129 |
-
gr.Markdown("<h1 style='text-align: center; margin-bottom:
|
|
|
130 |
gr.Markdown(description)
|
131 |
input_components = []
|
132 |
output_components = []
|
@@ -153,7 +157,7 @@ with gr.Blocks(title=title, theme=theme) as demo:
|
|
153 |
inputs=inputs,
|
154 |
outputs=outputs,
|
155 |
fn=inference,
|
156 |
-
cache_examples=True,
|
157 |
examples_per_page=7,
|
158 |
)
|
159 |
|
|
|
1 |
+
# burrow some code from https://huggingface.co/spaces/xvjiarui/ODISE/tree/main
|
2 |
import os
|
3 |
import sys
|
4 |
from importlib.util import find_spec
|
|
|
41 |
|
42 |
|
43 |
title = "TCL: Text-grounded Contrastive Learning"
|
44 |
+
title2 = "for Unsupervised Open-world Semantic Segmentation"
|
45 |
+
title = title + "<br/>" + title2
|
46 |
description_head = """
|
47 |
<p style='text-align: center'> <a href='https://arxiv.org/abs/2212.00785' target='_blank'>Paper</a> | <a href='https://github.com/kakaobrain/tcl' target='_blank'>Code</a> </p>
|
48 |
"""
|
|
|
129 |
|
130 |
theme = gr.themes.Soft(text_size=gr.themes.sizes.text_md, primary_hue="teal")
|
131 |
with gr.Blocks(title=title, theme=theme) as demo:
|
132 |
+
gr.Markdown("<h1 style='text-align: center; margin-bottom: 0rem'>" + title + "</h1>")
|
133 |
+
# gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>" + title2 + "</h1>")
|
134 |
gr.Markdown(description)
|
135 |
input_components = []
|
136 |
output_components = []
|
|
|
157 |
inputs=inputs,
|
158 |
outputs=outputs,
|
159 |
fn=inference,
|
160 |
+
# cache_examples=True,
|
161 |
examples_per_page=7,
|
162 |
)
|
163 |
|