Spaces:
Runtime error
Runtime error
nyonyong
commited on
Commit
·
373990d
1
Parent(s):
c3d71ae
Directory fix
Browse files
app.py
CHANGED
|
@@ -8,31 +8,22 @@ from urllib.parse import urlparse
|
|
| 8 |
gitblog = "https://bandalcom.github.io/"
|
| 9 |
github = "https://github.com/bandalcom/Postech-KITA_AI-Project"
|
| 10 |
|
| 11 |
-
#torch.hub.download_url_to_file('https://huggingface.co/spaces/Nebulae000/NoteCrawling/blob/main/noteimg2.jpg', 'noteimg2.jpg')
|
| 12 |
-
|
| 13 |
def HCR(im):
|
| 14 |
ps.clearDir()
|
| 15 |
ps.textDetection(im)
|
| 16 |
ps.textRearrange()
|
| 17 |
ps.textRecognition()
|
| 18 |
-
#subprocess.call('ls', shell=True)
|
| 19 |
hcr = ps.getHcrResult("/home/user/app"+Dir.txt_file_path)
|
| 20 |
subprocess.call('ls', shell=True)
|
| 21 |
-
#subprocess.call('cd'+ Dir.yolo_dir, shell=True)
|
| 22 |
ps.clearDir()
|
| 23 |
|
| 24 |
return hcr
|
| 25 |
|
| 26 |
-
title = "
|
| 27 |
description = "[Postech X KITA] Elite Undergradute AI Strategy Program | AI Project Competition Team 2 OCR Part"
|
| 28 |
-
article = "<p style='text-align: center'> Handwritten Text Character Recognition Task" \
|
| 29 |
-
"Text Detection + Text Rearrangement + Text Recognition
|
| 30 |
-
|
| 31 |
-
|
| 32 |
|
| 33 |
-
#<a href='https://github.com/bandalcom/Postech+KITA_AI-Project'>Source code</a>
|
| 34 |
-
#examples = [['zidane.jpg'], ['bus.jpg']]
|
| 35 |
-
#noteimg1 = torch.hub.download_url_to_file('https://ibb.co/JyMt31q', 'noteimg1.jpg')
|
| 36 |
-
#examples = [[noteimg1]]
|
| 37 |
-
#examples=examples,
|
| 38 |
gr.Interface(fn=HCR, inputs="image", outputs = "text", title=title, description=description, examples=[['noteimg1.jpg']], article=article, analytics_enabled=False).launch(debug=True)
|
|
|
|
| 8 |
gitblog = "https://bandalcom.github.io/"
|
| 9 |
github = "https://github.com/bandalcom/Postech-KITA_AI-Project"
|
| 10 |
|
|
|
|
|
|
|
| 11 |
def HCR(im):
|
| 12 |
ps.clearDir()
|
| 13 |
ps.textDetection(im)
|
| 14 |
ps.textRearrange()
|
| 15 |
ps.textRecognition()
|
|
|
|
| 16 |
hcr = ps.getHcrResult("/home/user/app"+Dir.txt_file_path)
|
| 17 |
subprocess.call('ls', shell=True)
|
|
|
|
| 18 |
ps.clearDir()
|
| 19 |
|
| 20 |
return hcr
|
| 21 |
|
| 22 |
+
title = "Note Crawling AI"
|
| 23 |
description = "[Postech X KITA] Elite Undergradute AI Strategy Program | AI Project Competition Team 2 OCR Part"
|
| 24 |
+
article = "<p style='text-align: center'> Handwritten Text Character Recognition Task<br>" \
|
| 25 |
+
"Text Detection + Text Rearrangement + Text Recognition<br>" \
|
| 26 |
+
"For More Information<br>" \
|
| 27 |
+
"<a href='https://bandalcom.github.io/'>GitBlog</a></p>"
|
| 28 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
gr.Interface(fn=HCR, inputs="image", outputs = "text", title=title, description=description, examples=[['noteimg1.jpg']], article=article, analytics_enabled=False).launch(debug=True)
|