Update app.py
Browse files10 unmodified lines11121314151415161717181920202122233 unmodified lines27282930303132323334351 unmodified line373839404010 unmodified linesmodel = LatexOCR(args)
if __name__ == '__main__': streamlit.set_page_config(page_title='LaTeX-OCR') streamlit.title('LaTeX OCR') streamlit.set_page_config(page_title='LaTeX-OCR_CN') streamlit.title('LaTeX OCR_CN') 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)') '将方程式或者数学公式的图像转换为相应的 LaTeX 代码,.\n\n这是基于pix2tex项目.查看[](https://github.com/lukas-blecher/LaTeX-OCR)')
uploaded_file = streamlit.file_uploader( 'Upload an image an equation', '上传公式图片', type=['png', 'jpg'], )
3 unmodified lines else: streamlit.text('\n')
if streamlit.button('Convert'): if streamlit.button('转换'): if uploaded_file is not None and image is not None: with streamlit.spinner('Computing'): with streamlit.spinner('计算中'): try: latex_code = model(image) streamlit.code(latex_code, language='latex')1 unmodified line except Exception as e: streamlit.error(e) else: streamlit.error('Please upload an image.') streamlit.error('请上传图片.')app.py+7-7