weide commited on
Commit
b75e591
·
1 Parent(s): 12ebd50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -11,13 +11,13 @@ args = Munch({'config': 'settings/config.yaml',
11
  model = LatexOCR(args)
12
 
13
  if __name__ == '__main__':
14
- streamlit.set_page_config(page_title='LaTeX-OCR')
15
- streamlit.title('LaTeX OCR')
16
  streamlit.markdown(
17
- 'Convert images of equations to corresponding LaTeX code.\n\nThis is based on the `pix2tex` module. Check it out [![github](https://img.shields.io/badge/LaTeX--OCR-visit-a?style=social&logo=github)](https://github.com/lukas-blecher/LaTeX-OCR)')
18
 
19
  uploaded_file = streamlit.file_uploader(
20
- 'Upload an image an equation',
21
  type=['png', 'jpg'],
22
  )
23
 
@@ -27,9 +27,9 @@ if __name__ == '__main__':
27
  else:
28
  streamlit.text('\n')
29
 
30
- if streamlit.button('Convert'):
31
  if uploaded_file is not None and image is not None:
32
- with streamlit.spinner('Computing'):
33
  try:
34
  latex_code = model(image)
35
  streamlit.code(latex_code, language='latex')
@@ -37,4 +37,4 @@ if __name__ == '__main__':
37
  except Exception as e:
38
  streamlit.error(e)
39
  else:
40
- streamlit.error('Please upload an image.')
 
11
  model = LatexOCR(args)
12
 
13
  if __name__ == '__main__':
14
+ streamlit.set_page_config(page_title='LaTeX-OCR_CN')
15
+ streamlit.title('LaTeX OCR_CN')
16
  streamlit.markdown(
17
+ '将方程式或者数学公式的图像转换为相应的 LaTeX 代码,.\n\n这是基于pix2tex项目.查看[![github](https://img.shields.io/badge/LaTeX--OCR-visit-a?style=social&logo=github)](https://github.com/lukas-blecher/LaTeX-OCR)')
18
 
19
  uploaded_file = streamlit.file_uploader(
20
+ '上传公式图片',
21
  type=['png', 'jpg'],
22
  )
23
 
 
27
  else:
28
  streamlit.text('\n')
29
 
30
+ if streamlit.button('转换'):
31
  if uploaded_file is not None and image is not None:
32
+ with streamlit.spinner('计算中'):
33
  try:
34
  latex_code = model(image)
35
  streamlit.code(latex_code, language='latex')
 
37
  except Exception as e:
38
  streamlit.error(e)
39
  else:
40
+ streamlit.error('请上传图片.')