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