SWHL commited on
Commit
134c129
1 Parent(s): e919229

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -14
app.py CHANGED
@@ -1,9 +1,9 @@
1
  # -*- encoding: utf-8 -*-
2
  # @Author: SWHL
3
  # @Contact: liekkaskono@163.com
4
- from pathlib import Path
5
-
6
  import streamlit as st
 
7
 
8
 
9
  if __name__ == '__main__':
@@ -18,15 +18,18 @@ if __name__ == '__main__':
18
  </p>
19
  """, unsafe_allow_html=True)
20
 
21
- st.markdown('戳这里查看支持模型列表:[PaddleOCR Models](https://github.com/PaddlePaddle/PaddleOCR/blob/release/2.6/doc/doc_ch/models_list.md)')
22
-
23
- default_url = 'e.g. https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar'
24
- url = st.text_input('输入模型地址:', help=default_url)
25
-
26
- default_txt_path = 'e.g. https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/ppocr_keys_v1.txt'
27
- txt_url = st.text_input('输入txt地址(文本识别模型时,必选):', help=default_txt_path)
28
-
29
- save_dir = 'models'
30
- save_onnx_path = ''
31
-
32
- is_convert = st.button('Convert')
 
 
 
 
1
  # -*- encoding: utf-8 -*-
2
  # @Author: SWHL
3
  # @Contact: liekkaskono@163.com
4
+ import numpy as np
 
5
  import streamlit as st
6
+ from PIL import Image
7
 
8
 
9
  if __name__ == '__main__':
 
18
  </p>
19
  """, unsafe_allow_html=True)
20
 
21
+ img_suffix = ["png", "jpg", "jpeg"]
22
+
23
+ st.markdown('##### rapid-orientation (文档图像分类) demo')
24
+ img_empty = st.empty()
25
+ img_file_buffer = st.file_uploader("Upload an image",
26
+ type=img_suffix,
27
+ label_visibility='hidden')
28
+ if img_file_buffer:
29
+ image = Image.open(img_file_buffer)
30
+ img_array = np.array(image)
31
+ if image:
32
+ img_empty.image(image, use_column_width=True)
33
+
34
+ st.markdown('##### rapid-layout (版面分析) demo')
35
+ st.markdown('##### rapid-table (表格还原) demo')