CoolFace
Apppublic

JacobLinCool/captcha-recognizer

sourceHugging Faceupdated 3y agoView on Hugging Face
1likes
app.py28 linesDownload Raw Back to src
1import gradio as gr2import numpy as np3from preprocess import preprocess4from solve import solve5 6 7def run(img: np.ndarray) -> tuple[np.ndarray, str]:8    preprocessed = preprocess(img)9 10    solved = solve(preprocessed)11 12    return preprocessed, solved13 14 15app = gr.Interface(16    fn=run,17    inputs=[18        gr.Image(label="captcha image", shape=(108, 30)),19    ],20    outputs=[21        gr.Image(label="preprocessed", shape=(108, 30)),22        gr.Textbox(label="solved"),23    ],24    allow_flagging="never",25)26 27app.queue().launch()28