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 images for accurate English / Latin OCR. Works best with document images and document type of texts " ) iface.launch(share=True)