No font for now
Browse files
app.py
CHANGED
@@ -64,10 +64,11 @@ def solve(file_obj):
|
|
64 |
boxes = [line[0] for line in result]
|
65 |
txts = [line[1][0] for line in result]
|
66 |
scores = [line[1][1] for line in result]
|
67 |
-
|
|
|
68 |
im_show = Image.fromarray(im_show)
|
69 |
im_show.save('result.jpg')
|
70 |
-
return
|
71 |
|
72 |
title = 'Cathode-Ray Tube'
|
73 |
description = 'Day 10 2022 AoC using OCR!!!'
|
@@ -76,7 +77,7 @@ css = ".output_image {height: 40rem !important; width: 100% !important;}"
|
|
76 |
gr.Interface(
|
77 |
solve,
|
78 |
[gr.File(file_types='text', label='Input')],
|
79 |
-
[
|
80 |
title=title,
|
81 |
description=description,
|
82 |
article=article,
|
|
|
64 |
boxes = [line[0] for line in result]
|
65 |
txts = [line[1][0] for line in result]
|
66 |
scores = [line[1][1] for line in result]
|
67 |
+
# TODO: Need to upload a font
|
68 |
+
# im_show = draw_ocr(image, boxes, txts, scores)
|
69 |
im_show = Image.fromarray(im_show)
|
70 |
im_show.save('result.jpg')
|
71 |
+
return txts, 'day_10.png'
|
72 |
|
73 |
title = 'Cathode-Ray Tube'
|
74 |
description = 'Day 10 2022 AoC using OCR!!!'
|
|
|
77 |
gr.Interface(
|
78 |
solve,
|
79 |
[gr.File(file_types='text', label='Input')],
|
80 |
+
["Solution", gr.outputs.Image(type='file', label='Image')],
|
81 |
title=title,
|
82 |
description=description,
|
83 |
article=article,
|