Spaces:
Running
Running
lower load manager threshold and pixel size
Browse files- localization.py +4 -5
localization.py
CHANGED
@@ -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 |
|
@@ -155,8 +155,7 @@ def app():
|
|
155 |
|
156 |
with st.spinner("Waiting for resources..."):
|
157 |
sleep_time = 5
|
158 |
-
|
159 |
-
while psutil.cpu_percent() > 60:
|
160 |
time.sleep(sleep_time)
|
161 |
|
162 |
if not caption or not image_url:
|
@@ -175,7 +174,7 @@ def app():
|
|
175 |
gc.collect()
|
176 |
|
177 |
elif image_url:
|
178 |
-
|
179 |
-
image = Image.open(
|
180 |
with col1:
|
181 |
st.image(image)
|
|
|
142 |
col1, col2 = st.beta_columns([3, 1])
|
143 |
|
144 |
with col2:
|
145 |
+
pixel_size = st.selectbox("Pixel Size", options=range(15, 26, 5), index=1)
|
146 |
|
147 |
iterations = st.selectbox("Refinement Steps", options=range(3, 30, 3), index=0)
|
148 |
|
|
|
155 |
|
156 |
with st.spinner("Waiting for resources..."):
|
157 |
sleep_time = 5
|
158 |
+
while psutil.cpu_percent() > 50:
|
|
|
159 |
time.sleep(sleep_time)
|
160 |
|
161 |
if not caption or not image_url:
|
|
|
174 |
gc.collect()
|
175 |
|
176 |
elif image_url:
|
177 |
+
image = requests.get(image_url, stream=True,).raw
|
178 |
+
image = Image.open(image).convert("RGB")
|
179 |
with col1:
|
180 |
st.image(image)
|