File size: 1,904 Bytes
c9ad304
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
30
31
32
33
34
35
36
# -*- encoding: utf-8 -*-
# @Author: SWHL
# @Contact: [email protected]
import numpy as np
import streamlit as st
from PIL import Image


if __name__ == '__main__':
    st.markdown("<h1 style='text-align: center;'><a href='https://github.com/RapidAI/RapidStructure' style='text-decoration: none'>Rapid Structure</a></h1>", unsafe_allow_html=True)
    st.markdown("""
    <p align="left">
        <a href=""><img src="https://img.shields.io/badge/Python->=3.7,<=3.10-aff.svg"></a>
        <a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a>
        <a href="https://pepy.tech/project/rapid-layout"><img src="https://static.pepy.tech/personalized-badge/rapid-layout?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=rapid-layout"></a>
        <a href="https://pepy.tech/project/rapid-orientation"><img src="https://static.pepy.tech/personalized-badge/rapid-orientation?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=rapid-orientation"></a>
        <a href="https://pepy.tech/project/rapid-table"><img src="https://static.pepy.tech/personalized-badge/rapid-table?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=rapid-table"></a>
    </p>
    """, unsafe_allow_html=True)

    img_suffix = ["png", "jpg", "jpeg"]

    st.markdown('##### rapid-orientation (文档图像分类) demo')
    img_empty = st.empty()
    img_file_buffer = st.file_uploader("Upload an image",
                                       type=img_suffix,
                                       label_visibility='hidden')
    if img_file_buffer:
        image = Image.open(img_file_buffer)
        img_array = np.array(image)
        if image:
            img_empty.image(image, use_column_width=True)

    st.markdown('##### rapid-layout (版面分析) demo')
    st.markdown('##### rapid-table (表格还原) demo')