SWHL commited on
Commit
25fb476
1 Parent(s): f99943e

Init commit

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # -*- encoding: utf-8 -*-
2
+ # @Author: SWHL
3
+ # @Contact: liekkaskono@163.com
4
+ import streamlit as st
5
+
6
+ from paddleocr_convert import PaddleOCRModelConvert
7
+
8
+
9
+ converter = PaddleOCRModelConvert()
10
+
11
+ st.header("PaddleOCRModelConverter Online")
12
+
13
+
14
+ eg_url = 'https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar'
15
+ url = st.text_input('输入模型地址:', placeholder=eg_url)
16
+
17
+ eg_txt_url = 'https://raw.githubusercontent.com/PaddlePaddle/PaddleOCR/release/2.6/ppocr/utils/dict/chinese_cht_dict.txt'
18
+ txt_url = st.text_input('输入txt地址(文本识别模型时,必选):', placeholder=eg_txt_url)
19
+
20
+ save_dir = 'models'
21
+ col1, col2 = st.columns(2)
22
+ with col1:
23
+ is_convert = st.button('Convert')
24
+ if is_convert:
25
+ converter(url, save_dir, txt_path=txt_url)
26
+
27
+ with col2:
28
+ is_download = st.download_button('Download', '')