File size: 1,073 Bytes
30c8b41
 
58c6ff9
30c8b41
 
0477fd5
30c8b41
7c8b66e
 
3cf3bc0
30c8b41
cf12374
30c8b41
 
 
7e61ba7
8cd31d2
cf12374
30c8b41
 
 
373990d
30c8b41
373990d
 
 
 
30c8b41
c3d71ae
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
import gradio as gr
import subprocess
import torch
import directories as Dir
import process as ps
from urllib.parse import urlparse

gitblog = "https://bandalcom.github.io/"
github = "https://github.com/bandalcom/Postech-KITA_AI-Project"

def HCR(im):
    ps.clearDir()
    ps.textDetection(im)
    ps.textRearrange()
    ps.textRecognition()
    hcr = ps.getHcrResult("/home/user/app"+Dir.txt_file_path)
    subprocess.call('ls', shell=True)
    ps.clearDir()

    return hcr

title = "Note Crawling AI"
description = "[Postech X KITA] Elite Undergradute AI Strategy Program | AI Project Competition Team 2 OCR Part"
article = "<p style='text-align: center'> Handwritten Text Character Recognition Task<br>" \
          "Text Detection + Text Rearrangement + Text Recognition<br>" \
          "For More Information<br>" \
          "<a href='https://bandalcom.github.io/'>GitBlog</a></p>"

gr.Interface(fn=HCR, inputs="image", outputs = "text", title=title, description=description, examples=[['noteimg1.jpg']], article=article, analytics_enabled=False).launch(debug=True)