Update app.py
Browse files10 unmodified lines111213141516171819202122233 unmodified lines2728293031323334351 unmodified line3738394010 unmodified linesmodel = LatexOCR(args)if __name__ == '__main__':streamlit.set_page_config(page_title='LaTeX-OCR')streamlit.title('LaTeX OCR')streamlit.markdown('Convert images of equations to corresponding LaTeX code.\n\nThis is based on the `pix2tex` module. Check it out [](https://github.com/lukas-blecher/LaTeX-OCR)')uploaded_file = streamlit.file_uploader('Upload an image an equation',type=['png', 'jpg'],)3 unmodified lineselse:streamlit.text('\n')if streamlit.button('Convert'):if uploaded_file is not None and image is not None:with streamlit.spinner('Computing'):try:latex_code = model(image)streamlit.code(latex_code, language='latex')1 unmodified lineexcept Exception as e:streamlit.error(e)else:streamlit.error('Please upload an image.')10 unmodified lines111213141516171819202122233 unmodified lines2728293031323334351 unmodified line3738394010 unmodified linesmodel = LatexOCR(args)if __name__ == '__main__':streamlit.set_page_config(page_title='LaTeX-OCR_CN')streamlit.title('LaTeX OCR_CN')streamlit.markdown('将方程式或者数学公式的图像转换为相应的 LaTeX 代码,.\n\n这是基于pix2tex项目.查看[](https://github.com/lukas-blecher/LaTeX-OCR)')uploaded_file = streamlit.file_uploader('上传公式图片',type=['png', 'jpg'],)3 unmodified lineselse:streamlit.text('\n')if streamlit.button('转换'):if uploaded_file is not None and image is not None:with streamlit.spinner('计算中'):try:latex_code = model(image)streamlit.code(latex_code, language='latex')1 unmodified lineexcept Exception as e:streamlit.error(e)else:streamlit.error('请上传图片.')
app.py+7-7