Spaces:
Runtime error
Runtime error
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) |