Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def get_latex_from_image_all_formats(image):
|
|
27 |
# Mathpix API ์์ฒญ ๋ฐ๋
|
28 |
data = {
|
29 |
"src": f"data:image/jpeg;base64,{image_base64}",
|
30 |
-
"formats":
|
31 |
}
|
32 |
|
33 |
# Mathpix API ์์ฒญ ๋ณด๋ด๊ธฐ
|
@@ -47,14 +47,14 @@ def build_gradio_app():
|
|
47 |
image_input = gr.Image(type="pil", label="์ด๋ฏธ์ง ์
๋ก๋")
|
48 |
submit_button = gr.Button("๋ณํํ๊ธฐ")
|
49 |
|
50 |
-
outputs = [gr.Textbox(label=f"{f} ๊ฒฐ๊ณผ") for f in
|
51 |
|
52 |
latex_iframe = gr.HTML(value='<iframe src="https://www.mathjax.org/#demo" style="width: 100%; height: 700px; border: 2px solid #007bff; border-radius: 8px;"></iframe>', elem_id="latex_iframe")
|
53 |
|
54 |
|
55 |
def process_and_output(image):
|
56 |
latex_result = get_latex_from_image_all_formats(image) # ๋ณ์๋ช
์์
|
57 |
-
return [latex_result.get(f) for f in
|
58 |
|
59 |
submit_button.click(fn=process_and_output, inputs=image_input, outputs=outputs)
|
60 |
|
|
|
27 |
# Mathpix API ์์ฒญ ๋ฐ๋
|
28 |
data = {
|
29 |
"src": f"data:image/jpeg;base64,{image_base64}",
|
30 |
+
"formats": "text"
|
31 |
}
|
32 |
|
33 |
# Mathpix API ์์ฒญ ๋ณด๋ด๊ธฐ
|
|
|
47 |
image_input = gr.Image(type="pil", label="์ด๋ฏธ์ง ์
๋ก๋")
|
48 |
submit_button = gr.Button("๋ณํํ๊ธฐ")
|
49 |
|
50 |
+
outputs = [gr.Textbox(label=f"{f} ๊ฒฐ๊ณผ") for f in "text"]
|
51 |
|
52 |
latex_iframe = gr.HTML(value='<iframe src="https://www.mathjax.org/#demo" style="width: 100%; height: 700px; border: 2px solid #007bff; border-radius: 8px;"></iframe>', elem_id="latex_iframe")
|
53 |
|
54 |
|
55 |
def process_and_output(image):
|
56 |
latex_result = get_latex_from_image_all_formats(image) # ๋ณ์๋ช
์์
|
57 |
+
return [latex_result.get(f) for f in "text"] # ์์ ๋ ๋ถ๋ถ
|
58 |
|
59 |
submit_button.click(fn=process_and_output, inputs=image_input, outputs=outputs)
|
60 |
|