jovian commited on
Commit
9a09e4e
·
1 Parent(s): 8739f3b
Files changed (1) hide show
  1. app.py +91 -89
app.py CHANGED
@@ -231,93 +231,6 @@ def generate_graphs_btn(annotations):
231
  frequency_graph = detection.generate_frequency_graph(annotations)
232
  return individual_graphs
233
 
234
- css = """
235
-
236
- @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&family=Montserrat:wght@700&family=Open+Sans&family=Poppins:wght@300;400;500;600;700;800&display=swap');
237
-
238
- header{
239
- padding: 0 80px;
240
- height: calc(100vh-80px);
241
- display: flex;
242
- align-items: center;
243
- justify-content: space-between;
244
- }
245
-
246
- header .left h1 {
247
- font-size: 80px;
248
- display: flex;
249
- justify-content: center;
250
- margin-top: 17rem;
251
-
252
- }
253
-
254
- header .left span{
255
- font-size: 80px;
256
- color: #083484;
257
- display: flex;
258
- justify-content: center;
259
-
260
- }
261
- header .left .second-line{
262
- font-size: 80px;
263
- color: #083484;
264
- display: flex;
265
- justify-content: center;
266
- font-weight: 400;
267
-
268
- }
269
-
270
- header .left p{
271
- margin-top: 35px;
272
- font-stretch: ultra-condensed;
273
- color: #777;
274
- display: flex;
275
- justify-content: center;
276
- text-align: center;
277
- margin-bottom: 10px;
278
- }
279
-
280
- header .left a{
281
- display: flex;
282
- align-items: center;
283
- background: #083484;
284
- width: 150px;
285
- padding: 8px;
286
- border-radius: 60px;
287
- }
288
-
289
- header .left a i{
290
- background-color: #fff;
291
- font-size: 24px;
292
- border-radius: 50%;
293
- padding: 8px;
294
- }
295
-
296
- header .left a span{
297
- color: #fff;
298
- margin-left: 22px;
299
- }
300
-
301
- .container {
302
- padding:30px;
303
- text-align: center;
304
- overflow: auto;
305
- margin-top: 500px;
306
- }
307
-
308
- .sub-header {
309
- font-size: 4em;
310
- text-align: center;
311
- color: #083484;
312
- font-family: 'Montserrat',sans-serif;
313
- }
314
-
315
-
316
-
317
-
318
- """
319
-
320
-
321
 
322
  js_func = """
323
  function refresh() {
@@ -341,7 +254,7 @@ def login_auth(username, password):
341
 
342
 
343
  # Gradio interface components
344
- with gr.Blocks(css=css,js=js_func) as demo:
345
 
346
  # State variable to track login status
347
  login_successful = gr.State(value=False)
@@ -349,7 +262,92 @@ with gr.Blocks(css=css,js=js_func) as demo:
349
 
350
 
351
  with gr.Row(visible=False) as header_row:
352
- gr.HTML("""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
 
354
  <header>
355
  <div class="left">
@@ -461,6 +459,10 @@ with gr.Blocks(css=css,js=js_func) as demo:
461
 
462
  with gr.Column(scale=2):
463
  gr.Markdown("")
 
 
 
 
464
 
465
 
466
 
 
231
  frequency_graph = detection.generate_frequency_graph(annotations)
232
  return individual_graphs
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
  js_func = """
236
  function refresh() {
 
254
 
255
 
256
  # Gradio interface components
257
+ with gr.Blocks(js=js_func) as demo:
258
 
259
  # State variable to track login status
260
  login_successful = gr.State(value=False)
 
262
 
263
 
264
  with gr.Row(visible=False) as header_row:
265
+ gr.HTML("""
266
+
267
+
268
+ <style>
269
+ @import url('https://fonts.googleapis.com/css2?family=Ubuntu:wght@300;400;500;700&family=Montserrat:wght@700&family=Open+Sans&family=Poppins:wght@300;400;500;600;700;800&display=swap');
270
+
271
+ header{
272
+ padding: 0 80px;
273
+ height: calc(100vh-80px);
274
+ display: flex;
275
+ align-items: center;
276
+ justify-content: space-between;
277
+ }
278
+
279
+ header .left h1 {
280
+ font-size: 80px;
281
+ display: flex;
282
+ justify-content: center;
283
+ margin-top: 17rem;
284
+
285
+ }
286
+
287
+ header .left span{
288
+ font-size: 80px;
289
+ color: #083484;
290
+ display: flex;
291
+ justify-content: center;
292
+
293
+ }
294
+ header .left .second-line{
295
+ font-size: 80px;
296
+ color: #083484;
297
+ display: flex;
298
+ justify-content: center;
299
+ font-weight: 400;
300
+
301
+ }
302
+
303
+ header .left p{
304
+ margin-top: 35px;
305
+ font-stretch: ultra-condensed;
306
+ color: #777;
307
+ display: flex;
308
+ justify-content: center;
309
+ text-align: center;
310
+ margin-bottom: 10px;
311
+ }
312
+
313
+ header .left a{
314
+ display: flex;
315
+ align-items: center;
316
+ background: #083484;
317
+ width: 150px;
318
+ padding: 8px;
319
+ border-radius: 60px;
320
+ }
321
+
322
+ header .left a i{
323
+ background-color: #fff;
324
+ font-size: 24px;
325
+ border-radius: 50%;
326
+ padding: 8px;
327
+ }
328
+
329
+ header .left a span{
330
+ color: #fff;
331
+ margin-left: 22px;
332
+ }
333
+
334
+ .container {
335
+ padding:30px;
336
+ text-align: center;
337
+ overflow: auto;
338
+ margin-top: 500px;
339
+ }
340
+
341
+ .sub-header {
342
+ font-size: 4em;
343
+ text-align: center;
344
+ color: #083484;
345
+ font-family: 'Montserrat',sans-serif;
346
+ }
347
+
348
+
349
+
350
+ </style>
351
 
352
  <header>
353
  <div class="left">
 
459
 
460
  with gr.Column(scale=2):
461
  gr.Markdown("")
462
+ # Footer Row
463
+ with gr.Row():
464
+ with gr.Column(scale=4):
465
+ gr.HTML('<center><i>© 2024 OIS AI Defect Detection Model</center>')
466
 
467
 
468