Spaces:
Running
Running
allow pixel size 10 and cache get_heatmap
Browse files- localization.py +2 -2
localization.py
CHANGED
@@ -73,7 +73,7 @@ def gen_image_batch(image_url, image_size=224, pixel_size=10):
|
|
73 |
|
74 |
return image_batch, masks
|
75 |
|
76 |
-
|
77 |
def get_heatmap(image_url, text, pixel_size=10, iterations=3):
|
78 |
tokenizer = get_tokenizer()
|
79 |
model = get_model()
|
@@ -142,7 +142,7 @@ def app():
|
|
142 |
col1, col2 = st.beta_columns([3, 1])
|
143 |
|
144 |
with col2:
|
145 |
-
pixel_size = st.selectbox("Pixel Size", options=range(
|
146 |
|
147 |
iterations = st.selectbox("Refinement Steps", options=range(3, 30, 3), index=0)
|
148 |
|
|
|
73 |
|
74 |
return image_batch, masks
|
75 |
|
76 |
+
@st.cache
|
77 |
def get_heatmap(image_url, text, pixel_size=10, iterations=3):
|
78 |
tokenizer = get_tokenizer()
|
79 |
model = get_model()
|
|
|
142 |
col1, col2 = st.beta_columns([3, 1])
|
143 |
|
144 |
with col2:
|
145 |
+
pixel_size = st.selectbox("Pixel Size", options=range(10, 26, 5), index=2)
|
146 |
|
147 |
iterations = st.selectbox("Refinement Steps", options=range(3, 30, 3), index=0)
|
148 |
|