Nischay103 commited on
Commit
531b32b
·
verified ·
1 Parent(s): 2ac0f48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -91,19 +91,16 @@ if uploaded_file is not None:
91
  st.write(f"Recognized Character Sequence: {output}")
92
 
93
  st.write("## examples")
 
94
  cols = st.columns(4)
95
- # for idx,(model_variant,captcha_path) in enumerate(example_captchas.items()):
96
- # col = cols[idx % 4]
97
- # col.image(captcha_path,caption=f'{captcha_path.split("/")[-1]}', width=100)
98
- # col.write(f"Model Version: {model_variant}")
99
 
100
  for idx,(model_variant,captcha_path) in enumerate(example_captchas.items()):
101
  with cols[idx % 4]:
102
- st.image(captcha_path, caption=f'{captcha_path.split("/")[-1]}', width=130)
103
  if st.button(f"Recognize with {model_variant}", key=f"button_{idx}"):
104
  input = transform_image(captcha_path)
105
  model = models[model_variant]
106
  with torch.no_grad():
107
  model_prediction = model(input)
108
  output = get_label(model_prediction, model_variant)
109
- st.write(f"Model {model_variant} recognized: {output}")
 
91
  st.write(f"Recognized Character Sequence: {output}")
92
 
93
  st.write("## examples")
94
+ __placeholder__ = st.empty()
95
  cols = st.columns(4)
 
 
 
 
96
 
97
  for idx,(model_variant,captcha_path) in enumerate(example_captchas.items()):
98
  with cols[idx % 4]:
99
+ st.image(captcha_path, caption=f'{captcha_path.split("/")[-1]}', width=160)
100
  if st.button(f"Recognize with {model_variant}", key=f"button_{idx}"):
101
  input = transform_image(captcha_path)
102
  model = models[model_variant]
103
  with torch.no_grad():
104
  model_prediction = model(input)
105
  output = get_label(model_prediction, model_variant)
106
+ __placeholder__.write(f"Model {model_variant} recognized: {output}")