Spaces:
Running
Running
Upload 2 files
Browse files- app.py +4 -2
- header.html +109 -0
app.py
CHANGED
|
@@ -296,12 +296,14 @@ def select_example3():
|
|
| 296 |
return gr.update(value=gt, placeholder='type gt latex code here'), gr.update(value=pred, placeholder='type pred latex code here')
|
| 297 |
|
| 298 |
|
|
|
|
|
|
|
| 299 |
|
| 300 |
if __name__ == "__main__":
|
| 301 |
-
title = """<h1 align="center">CDM: A Reliable Metric for Fair and Accurate Formula Recognition Evaluation</h1>"""
|
| 302 |
|
| 303 |
with gr.Blocks() as demo:
|
| 304 |
-
gr.Markdown(
|
| 305 |
|
| 306 |
# gr.Button(value="Quick Try: type latex code of gt and pred, get metrics and visualization.", interactive=False, variant="primary")
|
| 307 |
|
|
|
|
| 296 |
return gr.update(value=gt, placeholder='type gt latex code here'), gr.update(value=pred, placeholder='type pred latex code here')
|
| 297 |
|
| 298 |
|
| 299 |
+
with open("header.html", "r") as file:
|
| 300 |
+
header = file.read()
|
| 301 |
|
| 302 |
if __name__ == "__main__":
|
| 303 |
+
# title = """<h1 align="center">CDM: A Reliable Metric for Fair and Accurate Formula Recognition Evaluation</h1>"""
|
| 304 |
|
| 305 |
with gr.Blocks() as demo:
|
| 306 |
+
gr.Markdown(header)
|
| 307 |
|
| 308 |
# gr.Button(value="Quick Try: type latex code of gt and pred, get metrics and visualization.", interactive=False, variant="primary")
|
| 309 |
|
header.html
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<html><head>
|
| 2 |
+
<!-- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css"> -->
|
| 3 |
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css">
|
| 4 |
+
<style>
|
| 5 |
+
.link-block {
|
| 6 |
+
border: 1px solid transparent;
|
| 7 |
+
border-radius: 24px;
|
| 8 |
+
background-color: rgba(54, 54, 54, 1);
|
| 9 |
+
cursor: pointer !important;
|
| 10 |
+
}
|
| 11 |
+
.link-block:hover {
|
| 12 |
+
background-color: rgba(54, 54, 54, 0.75) !important;
|
| 13 |
+
cursor: pointer !important;
|
| 14 |
+
}
|
| 15 |
+
.external-link {
|
| 16 |
+
display: inline-flex;
|
| 17 |
+
align-items: center;
|
| 18 |
+
height: 36px;
|
| 19 |
+
line-height: 36px;
|
| 20 |
+
padding: 0 16px;
|
| 21 |
+
cursor: pointer !important;
|
| 22 |
+
}
|
| 23 |
+
.external-link,
|
| 24 |
+
.external-link:hover {
|
| 25 |
+
cursor: pointer !important;
|
| 26 |
+
}
|
| 27 |
+
a {
|
| 28 |
+
text-decoration: none;
|
| 29 |
+
}
|
| 30 |
+
</style></head>
|
| 31 |
+
|
| 32 |
+
<body>
|
| 33 |
+
<div style="
|
| 34 |
+
display: flex;
|
| 35 |
+
flex-direction: column;
|
| 36 |
+
justify-content: center;
|
| 37 |
+
align-items: center;
|
| 38 |
+
text-align: center;
|
| 39 |
+
background: linear-gradient(45deg, #007bff 0%, #0056b3 100%);
|
| 40 |
+
padding: 24px;
|
| 41 |
+
gap: 24px;
|
| 42 |
+
border-radius: 8px;
|
| 43 |
+
">
|
| 44 |
+
<div style="
|
| 45 |
+
display: flex;
|
| 46 |
+
flex-direction: column;
|
| 47 |
+
align-items: center;
|
| 48 |
+
gap: 16px;
|
| 49 |
+
">
|
| 50 |
+
<div style="display: flex; flex-direction: column; gap: 8px">
|
| 51 |
+
<h1 style="
|
| 52 |
+
font-size: 48px;
|
| 53 |
+
color: #fafafa;
|
| 54 |
+
margin: 0;
|
| 55 |
+
font-family: 'Trebuchet MS', 'Lucida Sans Unicode',
|
| 56 |
+
'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
| 57 |
+
">
|
| 58 |
+
CDM (Character Detection Matching)
|
| 59 |
+
</h1>
|
| 60 |
+
</div>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<p style="
|
| 64 |
+
margin: 0;
|
| 65 |
+
line-height: 1.6rem;
|
| 66 |
+
font-size: 16px;
|
| 67 |
+
color: #fafafa;
|
| 68 |
+
opacity: 0.8;
|
| 69 |
+
">
|
| 70 |
+
A Reliable Metric for Fair and Accurate Formula Recognition.<br>
|
| 71 |
+
</p>
|
| 72 |
+
<style>
|
| 73 |
+
.link-block {
|
| 74 |
+
display: inline-block;
|
| 75 |
+
}
|
| 76 |
+
.link-block + .link-block {
|
| 77 |
+
margin-left: 20px;
|
| 78 |
+
}
|
| 79 |
+
</style>
|
| 80 |
+
|
| 81 |
+
<div class="column has-text-centered">
|
| 82 |
+
<div class="publication-links">
|
| 83 |
+
<!-- Code Link. -->
|
| 84 |
+
<span class="link-block">
|
| 85 |
+
<a href="https://github.com/opendatalab/UniMERNet/tree/dev/CDM" class="external-link button is-normal is-rounded is-dark" style="text-decoration: none; cursor: pointer">
|
| 86 |
+
<span class="icon" style="margin-right: 4px">
|
| 87 |
+
<i class="fab fa-github" style="color: white; margin-right: 4px"></i>
|
| 88 |
+
</span>
|
| 89 |
+
<span style="color: white">Code</span>
|
| 90 |
+
</a>
|
| 91 |
+
</span>
|
| 92 |
+
|
| 93 |
+
<!-- Paper Link. -->
|
| 94 |
+
<span class="link-block">
|
| 95 |
+
<a href="https://arxiv.org/pdf/2409.03643" class="external-link button is-normal is-rounded is-dark" style="text-decoration: none; cursor: pointer">
|
| 96 |
+
<span class="icon" style="margin-right: 8px">
|
| 97 |
+
<i class="fas fa-globe" style="color: white"></i>
|
| 98 |
+
</span>
|
| 99 |
+
<span style="color: white">Paper</span>
|
| 100 |
+
</a>
|
| 101 |
+
</span>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
<!-- New Demo Links -->
|
| 106 |
+
</div>
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
</body></html>
|