from text_detection import Text_Detection import gradio as gr def get_response(input_img): return text_detector.predict([input_img]) if __name__ == "__main__": text_detector=Text_Detection('models/text_detector.xml') iface = gr.Interface( fn=get_response, inputs=gr.Image(type="numpy"), # Accepts image input outputs=gr.Textbox(), title="SVTR-OCR-App", description="Upload cropped text for accurate Latin OCR" ) iface.launch(share=True)