Spaces:
Sleeping
Sleeping
juhoinkinen
commited on
More resemblance to annif.org
Browse files
app.py
CHANGED
@@ -71,55 +71,32 @@ def process(image, project_num: int, lang: str = "eng"):
|
|
71 |
langs = ("eng", "fin", "swe")
|
72 |
|
73 |
css = """
|
74 |
-
.gradio-container, .gradio-container
|
75 |
color: #343260 !important;
|
76 |
background-color: #f3f3f6;
|
77 |
color: #343260;
|
78 |
font-family: Jost, sans-serif;
|
79 |
font-weight: 400;
|
80 |
-
font-size:
|
81 |
-
line-height: 1
|
82 |
-
}
|
83 |
-
body, .mygrclass {
|
84 |
-
background-color: #f3f3f6;
|
85 |
-
color: #343260;
|
86 |
-
font-family: Jost, sans-serif;
|
87 |
-
font-weight: 400;
|
88 |
-
font-size: 1.2rem;
|
89 |
-
line-height: 1.2;
|
90 |
-
}
|
91 |
-
.container {
|
92 |
-
max-width: 1140px;
|
93 |
-
margin: 0 auto;
|
94 |
-
padding: 0 15px;
|
95 |
}
|
96 |
h1, h1 a {
|
|
|
97 |
font-weight: 500;
|
98 |
font-size: 2rem;
|
99 |
text-align: center;
|
100 |
}
|
101 |
h2 {
|
102 |
font-weight: 500;
|
103 |
-
font-size: 1.
|
104 |
padding: 0.5rem 0;
|
105 |
}
|
106 |
-
#form {
|
107 |
-
background: linear-gradient(to bottom, #ffffff 0%, #d9dfe3 1%, #f3f3f6 1%, #f3f3f6 99%, #d9dfe3 99%, #ffffff 100%);
|
108 |
-
padding: 2rem 0;
|
109 |
-
}
|
110 |
-
.form-control {
|
111 |
-
border-radius: 0px;
|
112 |
-
}
|
113 |
#get-suggestions {
|
114 |
-
margin: 2rem 0;
|
115 |
-
background
|
116 |
-
color: white;
|
117 |
border: none;
|
118 |
border-radius: 0px;
|
119 |
-
padding-right: 3rem;
|
120 |
-
background-image: url('static/img/arrow-white.svg');
|
121 |
-
background-position: 97% center;
|
122 |
-
background-repeat: no-repeat;
|
123 |
}
|
124 |
#suggestions-wrapper {
|
125 |
background-color: #f3f3f6;
|
@@ -134,15 +111,23 @@ h2 {
|
|
134 |
.list-group-item {
|
135 |
display: flex;
|
136 |
align-items: center;
|
137 |
-
padding:
|
138 |
border-bottom: 1px solid #e0e0e0;
|
139 |
}
|
140 |
meter {
|
141 |
width: 24px;
|
142 |
margin-right: 10px;
|
143 |
}
|
|
|
|
|
|
|
144 |
meter::-webkit-meter-bar {
|
|
|
|
|
|
|
145 |
background-color: #ccc;
|
|
|
|
|
146 |
}
|
147 |
meter::-webkit-meter-optimum-value {
|
148 |
background: #6280dc;
|
@@ -161,7 +146,7 @@ with gr.Blocks(theme=gr.themes.Default(radius_size="none"), css=css) as demo:
|
|
161 |
with gr.Column(scale=1):
|
162 |
project = gr.Dropdown(choices=proj_names, label="Project (vocabulary and language)", type="index", elem_classes="mygrclass", value=proj_names[2])
|
163 |
lang = gr.Dropdown(choices=langs, label="Select Language for OCR", type="value", value="eng", elem_classes="mygrclass")
|
164 |
-
submit_btn = gr.Button("Get suggestions", elem_id="get-suggestions", elem_classes="mygrclass")
|
165 |
|
166 |
with gr.Row():
|
167 |
with gr.Column(scale=3):
|
|
|
71 |
langs = ("eng", "fin", "swe")
|
72 |
|
73 |
css = """
|
74 |
+
.gradio-container, .gradio-container *, body, .mygrclass {
|
75 |
color: #343260 !important;
|
76 |
background-color: #f3f3f6;
|
77 |
color: #343260;
|
78 |
font-family: Jost, sans-serif;
|
79 |
font-weight: 400;
|
80 |
+
font-size: 1rem;
|
81 |
+
line-height: 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
}
|
83 |
h1, h1 a {
|
84 |
+
padding: 2rem 0;
|
85 |
font-weight: 500;
|
86 |
font-size: 2rem;
|
87 |
text-align: center;
|
88 |
}
|
89 |
h2 {
|
90 |
font-weight: 500;
|
91 |
+
font-size: 1.2rem;
|
92 |
padding: 0.5rem 0;
|
93 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
#get-suggestions {
|
95 |
+
margin: 2rem 0 0 0;
|
96 |
+
background: #6280dc;
|
97 |
+
color: white !important;
|
98 |
border: none;
|
99 |
border-radius: 0px;
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
#suggestions-wrapper {
|
102 |
background-color: #f3f3f6;
|
|
|
111 |
.list-group-item {
|
112 |
display: flex;
|
113 |
align-items: center;
|
114 |
+
padding: 1px 0;
|
115 |
border-bottom: 1px solid #e0e0e0;
|
116 |
}
|
117 |
meter {
|
118 |
width: 24px;
|
119 |
margin-right: 10px;
|
120 |
}
|
121 |
+
meter:-moz-meter-optimum::-moz-meter-bar {
|
122 |
+
background: #6280dc;
|
123 |
+
}
|
124 |
meter::-webkit-meter-bar {
|
125 |
+
border: none;
|
126 |
+
border-radius: 0;
|
127 |
+
height: 18px;
|
128 |
background-color: #ccc;
|
129 |
+
box-shadow: 0 12px 3px -5px #e6e6e6 inset;
|
130 |
+
margin: 2 rem;
|
131 |
}
|
132 |
meter::-webkit-meter-optimum-value {
|
133 |
background: #6280dc;
|
|
|
146 |
with gr.Column(scale=1):
|
147 |
project = gr.Dropdown(choices=proj_names, label="Project (vocabulary and language)", type="index", elem_classes="mygrclass", value=proj_names[2])
|
148 |
lang = gr.Dropdown(choices=langs, label="Select Language for OCR", type="value", value="eng", elem_classes="mygrclass")
|
149 |
+
submit_btn = gr.Button("Get text & suggestions", elem_id="get-suggestions", elem_classes="mygrclass")
|
150 |
|
151 |
with gr.Row():
|
152 |
with gr.Column(scale=3):
|