Spaces:
Paused
Paused
Update app.py
Browse files7 unmodified lines89101112131415161718192021222324251 unmodified line27282930313233343523 unmodified lines5960616263647 unmodified linesfrom rapidocr_pdf import RapidOCRPDFcustom_css = """body {font-family: body {font-family: 'Helvetica Neue', Helvetica;}.gr-button {background-color: #4CAF50; color: white; border: none; padding: 10px 20px; border-radius: 5px;}.gr-button:hover {background-color: #45a049;}.gr-textbox {margin-bottom: 15px;}.example-button {background-color: #1E90FF; color: white; border: none; padding: 8px 15px; border-radius: 5px; margin: 5px;}.example-button:hover {background-color: #FF4500;}.tall-radio .gr-radio-item {padding: 15px 0; min-height: 50px; display: flex; align-items: center;}.tall-radio label {font-size: 16px;}.output-image, .input-image, .image-preview {height: 300px !important}"""pdf_extracter = RapidOCRPDF()1 unmodified linereturn pdf_extracter(pdf_path, page_num_list=[page_num])with gr.Blocks(title="RapidOCR π PDF", css="custom_css", theme=gr.themes.Soft()) as demo:gr.Markdown("<h1 style='text-align: center;'><a href='https://github.com/RapidAI/RapidOCRPDF' style='text-decoration: none;'>RapidOCR π PDF</a></h1>")23 unmodified lines)btn.click(get_pdf_result, inputs=[pdf_path, page_num], outputs=[results])if __name__ == "__main__":demo.launch()7 unmodified lines89101112131 unmodified line1516171819202123 unmodified lines4546474849505152535455565758596061627 unmodified linesfrom rapidocr_pdf import RapidOCRPDFpdf_extracter = RapidOCRPDF()1 unmodified linereturn pdf_extracter(pdf_path, page_num_list=[page_num])with gr.Blocks(title="RapidOCR π PDF", theme=gr.themes.Soft()) as demo:gr.Markdown("<h1 style='text-align: center;'><a href='https://github.com/RapidAI/RapidOCRPDF' style='text-decoration: none;'>RapidOCR π PDF</a></h1>")23 unmodified lines)btn.click(get_pdf_result, inputs=[pdf_path, page_num], outputs=[results])examples = gr.Examples(examples=[["./files/direct_and_image.pdf", 0],["./files/direct_extract.pdf", 0],],examples_per_page=5,inputs=[pdf_path, page_num],fn=get_pdf_result,outputs=[results],cache_examples=False,)if __name__ == "__main__":demo.launch()
app.py+13-15