Spaces:
Runtime error
Runtime error
Update app.py
Browse files90 unmodified lines91929394959697989910010110210310410510610710810990 unmodified linesst.write(f"Recognized Character Sequence: {output}")st.write("## examples")cols = st.columns(4)# for idx,(model_variant,captcha_path) in enumerate(example_captchas.items()):# col = cols[idx % 4]# col.image(captcha_path,caption=f'{captcha_path.split("/")[-1]}', width=100)# col.write(f"Model Version: {model_variant}")for idx,(model_variant,captcha_path) in enumerate(example_captchas.items()):with cols[idx % 4]:st.image(captcha_path, caption=f'{captcha_path.split("/")[-1]}', width=130)if st.button(f"Recognize with {model_variant}", key=f"button_{idx}"):input = transform_image(captcha_path)model = models[model_variant]with torch.no_grad():model_prediction = model(input)output = get_label(model_prediction, model_variant)st.write(f"Model {model_variant} recognized: {output}")90 unmodified lines91929394959697989910010110210310410510690 unmodified linesst.write(f"Recognized Character Sequence: {output}")st.write("## examples")__placeholder__ = st.empty()cols = st.columns(4)for idx,(model_variant,captcha_path) in enumerate(example_captchas.items()):with cols[idx % 4]:st.image(captcha_path, caption=f'{captcha_path.split("/")[-1]}', width=160)if st.button(f"Recognize with {model_variant}", key=f"button_{idx}"):input = transform_image(captcha_path)model = models[model_variant]with torch.no_grad():model_prediction = model(input)output = get_label(model_prediction, model_variant)__placeholder__.write(f"Model {model_variant} recognized: {output}")
app.py+3-6