4rtemi5 commited on
Commit
e44c759
1 Parent(s): 83ec1c0

lower load manager threshold and pixel size

Browse files
Files changed (1) hide show
  1. 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(10, 21, 5), index=0)
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
- print("CPU_load", psutil.cpu_percent())
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
- image_raw = requests.get(image_url, stream=True,).raw
179
- image = Image.open(image_raw).convert("RGB")
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)