ApurvaKondekar commited on
Commit
60e07e7
Β·
verified Β·
1 Parent(s): 027f9ca
Files changed (1) hide show
  1. app.py +201 -40
app.py CHANGED
@@ -771,34 +771,184 @@ body::after {
771
 
772
  .cyber-card {
773
  background: #0d1e35 !important;
774
- border: 1px solid rgba(0, 245, 255, 0.3) !important;
775
- border-radius: 4px !important;
776
- padding: 22px 26px !important;
777
  position: relative;
778
  overflow: hidden;
779
  transition: border-color 0.3s, box-shadow 0.3s;
780
  }
781
 
 
 
 
 
 
782
  .cyber-card::before {
783
  content: '';
784
  position: absolute;
785
  top: 0; left: 0;
786
  width: 3px; height: 100%;
787
- background: linear-gradient(180deg, var(--neon-cyan), var(--neon-purple));
788
- box-shadow: 0 0 14px var(--neon-cyan);
 
789
  }
790
 
 
 
 
 
 
 
791
  .cyber-card::after {
792
  content: '';
793
  position: absolute;
794
  top: 0; right: 0;
795
  width: 80px; height: 80px;
796
- background: radial-gradient(circle, rgba(0,245,255,0.1) 0%, transparent 70%);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
797
  }
798
 
799
  .cyber-card:hover {
800
  border-color: rgba(0, 245, 255, 0.6) !important;
801
- box-shadow: 0 0 35px rgba(0, 245, 255, 0.15) !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
802
  }
803
 
804
  /* =====================================================
@@ -1213,24 +1363,16 @@ with gr.Blocks(
1213
  """)
1214
 
1215
  # ── Header ──────────────────────────────────────────
1216
- gr.HTML(f"""
1217
  <div class="cyber-header">
1218
  <div class="cyber-title" data-text="MULTIMODAL EMOTION RECOGNITION">
1219
  MULTIMODAL EMOTION RECOGNITION
1220
  </div>
1221
- <div class="cyber-subtitle">
1222
- Real-Time Neural Analysis &nbsp;Β·&nbsp; Audio &nbsp;/&nbsp; Text &nbsp;/&nbsp; Video Fusion
1223
- </div>
1224
  <div class="cyber-divider">
1225
  <div class="cyber-divider-dot"></div>
1226
  <div class="cyber-divider-dot" style="animation-delay:0.4s"></div>
1227
  <div class="cyber-divider-dot" style="animation-delay:0.8s"></div>
1228
  </div>
1229
- <div class="status-bar">
1230
- <div class="status-badge" style="border-color:{gpu_color}; color:{gpu_color}; background:rgba(0,255,136,0.06);">
1231
- β—‰ &nbsp; SYSTEM STATUS: {gpu_status}
1232
- </div>
1233
- </div>
1234
  </div>
1235
  """)
1236
 
@@ -1238,19 +1380,19 @@ with gr.Blocks(
1238
  gr.HTML("""
1239
  <div class="info-grid">
1240
  <div class="cyber-card">
1241
- <h4 style="font-family:'Orbitron',monospace;font-size:10px;letter-spacing:3px;color:#00f5ff;margin:0 0 14px;text-shadow:0 0 8px rgba(0,245,255,0.6);">MODALITIES</h4>
1242
- <div style="font-family:'Share Tech Mono',monospace;font-size:14px;line-height:2.2;color:#ffffff;">
1243
- <div><span style="color:#00f5ff;">β—ˆ</span> &nbsp;Audio Waveform Analysis</div>
1244
- <div><span style="color:#00f5ff;">β—ˆ</span> &nbsp;Speech Transcription (Whisper)</div>
1245
- <div><span style="color:#00f5ff;">β—ˆ</span> &nbsp;Facial Expression Mapping</div>
1246
  </div>
1247
  </div>
1248
- <div class="cyber-card" style="border-left-color:#bf00ff;">
1249
- <h4 style="font-family:'Orbitron',monospace;font-size:10px;letter-spacing:3px;color:#bf00ff;margin:0 0 14px;text-shadow:0 0 8px rgba(191,0,255,0.6);">NEURAL MODELS</h4>
1250
- <div style="font-family:'Share Tech Mono',monospace;font-size:14px;line-height:2.2;color:#ffffff;">
1251
- <div><span style="color:#bf00ff;">β—ˆ</span> &nbsp;Wav2Vec2 &nbsp;Β·&nbsp; BERT &nbsp;Β·&nbsp; ResNet18</div>
1252
- <div><span style="color:#bf00ff;">β—ˆ</span> &nbsp;Whisper ASR</div>
1253
- <div><span style="color:#bf00ff;">β—ˆ</span> &nbsp;Hybrid Bimodal Fusion (HBF)</div>
1254
  </div>
1255
  </div>
1256
  </div>
@@ -1305,19 +1447,38 @@ with gr.Blocks(
1305
  # ── About Accordion ─────────────────────────────────
1306
  with gr.Accordion("β—† SYSTEM ARCHITECTURE", open=False):
1307
 
1308
- gr.Markdown("""
1309
- ### Neural Pipeline
1310
-
1311
- This system fuses three independent encoders through a **Hybrid Bimodal Fusion (HBF)** block:
1312
-
1313
- - **Wav2Vec2** β€” Extracts deep acoustic features from the raw audio waveform
1314
- - **BERT** β€” Understands semantic and emotional tone from transcribed speech
1315
- - **ResNet18** β€” Captures facial micro-expressions across sampled video frames
1316
- - **HBF Block** β€” Iteratively aligns all three modalities over 6 fusion layers
1317
-
1318
- ### Detectable Emotions
1319
-
1320
- `ANGRY` &nbsp; `HAPPY` &nbsp; `NEUTRAL` &nbsp; `SAD`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1321
  """)
1322
 
1323
  # ── Footer ──────────────────────────────────────────
 
771
 
772
  .cyber-card {
773
  background: #0d1e35 !important;
774
+ border: 1px solid rgba(0, 245, 255, 0.35) !important;
775
+ border-radius: 6px !important;
776
+ padding: 0 !important;
777
  position: relative;
778
  overflow: hidden;
779
  transition: border-color 0.3s, box-shadow 0.3s;
780
  }
781
 
782
+ .cyber-card-purple {
783
+ border-color: rgba(191, 0, 255, 0.35) !important;
784
+ }
785
+
786
+ /* Glowing left bar */
787
  .cyber-card::before {
788
  content: '';
789
  position: absolute;
790
  top: 0; left: 0;
791
  width: 3px; height: 100%;
792
+ background: linear-gradient(180deg, #00f5ff, #bf00ff);
793
+ box-shadow: 0 0 14px #00f5ff;
794
+ z-index: 0;
795
  }
796
 
797
+ .cyber-card-purple::before {
798
+ background: linear-gradient(180deg, #bf00ff, #00f5ff);
799
+ box-shadow: 0 0 14px #bf00ff;
800
+ }
801
+
802
+ /* Corner glow β€” behind text */
803
  .cyber-card::after {
804
  content: '';
805
  position: absolute;
806
  top: 0; right: 0;
807
  width: 80px; height: 80px;
808
+ background: radial-gradient(circle, rgba(0,245,255,0.07) 0%, transparent 70%);
809
+ z-index: 0;
810
+ }
811
+
812
+ /* Content wrapper sits above pseudo-elements */
813
+ .card-inner {
814
+ position: relative;
815
+ z-index: 2;
816
+ padding: 22px 22px 22px 28px;
817
+ }
818
+
819
+ .card-label {
820
+ font-family: 'Orbitron', monospace;
821
+ font-size: 10px;
822
+ font-weight: 700;
823
+ letter-spacing: 3px;
824
+ text-transform: uppercase;
825
+ margin-bottom: 16px;
826
+ }
827
+
828
+ .card-row {
829
+ font-family: 'Share Tech Mono', monospace;
830
+ font-size: 13px;
831
+ color: #d8f0ff;
832
+ line-height: 2.2;
833
+ display: flex;
834
+ align-items: center;
835
+ gap: 10px;
836
+ }
837
+
838
+ .card-dot {
839
+ font-size: 12px;
840
+ flex-shrink: 0;
841
  }
842
 
843
  .cyber-card:hover {
844
  border-color: rgba(0, 245, 255, 0.6) !important;
845
+ box-shadow: 0 0 35px rgba(0, 245, 255, 0.12) !important;
846
+ }
847
+
848
+ .cyber-card-purple:hover {
849
+ border-color: rgba(191, 0, 255, 0.6) !important;
850
+ box-shadow: 0 0 35px rgba(191, 0, 255, 0.12) !important;
851
+ }
852
+
853
+ /* =====================================================
854
+ SYSTEM ARCHITECTURE STYLES
855
+ ===================================================== */
856
+ .arch-grid {
857
+ display: grid;
858
+ grid-template-columns: 3fr 2fr;
859
+ gap: 24px;
860
+ padding: 20px 4px 8px;
861
+ }
862
+
863
+ .arch-section {
864
+ display: flex;
865
+ flex-direction: column;
866
+ gap: 14px;
867
+ }
868
+
869
+ .arch-title {
870
+ font-family: 'Orbitron', monospace;
871
+ font-size: 11px;
872
+ font-weight: 700;
873
+ letter-spacing: 3px;
874
+ color: #00f5ff;
875
+ text-transform: uppercase;
876
+ border-bottom: 1px solid rgba(0,245,255,0.2);
877
+ padding-bottom: 8px;
878
+ margin-bottom: 4px;
879
+ }
880
+
881
+ .arch-desc {
882
+ font-family: 'Rajdhani', sans-serif;
883
+ font-size: 14px;
884
+ color: #a0c8d8;
885
+ line-height: 1.6;
886
+ margin: 0 0 8px;
887
+ }
888
+
889
+ .arch-row {
890
+ display: flex;
891
+ align-items: flex-start;
892
+ gap: 14px;
893
+ }
894
+
895
+ .arch-tag {
896
+ font-family: 'Orbitron', monospace;
897
+ font-size: 9px;
898
+ font-weight: 700;
899
+ letter-spacing: 1.5px;
900
+ border: 1px solid;
901
+ border-radius: 2px;
902
+ padding: 4px 8px;
903
+ white-space: nowrap;
904
+ flex-shrink: 0;
905
+ margin-top: 2px;
906
+ }
907
+
908
+ .arch-detail {
909
+ font-family: 'Share Tech Mono', monospace;
910
+ font-size: 13px;
911
+ color: #d0e8f0;
912
+ line-height: 1.6;
913
+ }
914
+
915
+ .emotion-chips {
916
+ display: grid;
917
+ grid-template-columns: 1fr 1fr;
918
+ gap: 10px;
919
+ margin-top: 4px;
920
+ }
921
+
922
+ .emotion-chip {
923
+ font-family: 'Orbitron', monospace;
924
+ font-size: 11px;
925
+ font-weight: 700;
926
+ letter-spacing: 2px;
927
+ border: 1px solid;
928
+ border-radius: 4px;
929
+ padding: 12px 10px;
930
+ text-align: center;
931
+ background: rgba(255,255,255,0.02);
932
+ transition: all 0.3s;
933
+ }
934
+
935
+ .emotion-chip:hover {
936
+ background: rgba(255,255,255,0.06);
937
+ transform: translateY(-2px);
938
+ }
939
+
940
+ /* =====================================================
941
+ HIDE GRADIO "USE API" / BUILT WITH FOOTER
942
+ ===================================================== */
943
+ .built-with,
944
+ a[href*="gradio"],
945
+ footer.svelte-1ax1toq,
946
+ .svelte-1ax1toq,
947
+ div[class*="built"],
948
+ .show-api,
949
+ button[title*="API"],
950
+ .api-btn {
951
+ display: none !important;
952
  }
953
 
954
  /* =====================================================
 
1363
  """)
1364
 
1365
  # ── Header ──────────────────────────────────────────
1366
+ gr.HTML("""
1367
  <div class="cyber-header">
1368
  <div class="cyber-title" data-text="MULTIMODAL EMOTION RECOGNITION">
1369
  MULTIMODAL EMOTION RECOGNITION
1370
  </div>
 
 
 
1371
  <div class="cyber-divider">
1372
  <div class="cyber-divider-dot"></div>
1373
  <div class="cyber-divider-dot" style="animation-delay:0.4s"></div>
1374
  <div class="cyber-divider-dot" style="animation-delay:0.8s"></div>
1375
  </div>
 
 
 
 
 
1376
  </div>
1377
  """)
1378
 
 
1380
  gr.HTML("""
1381
  <div class="info-grid">
1382
  <div class="cyber-card">
1383
+ <div class="card-inner">
1384
+ <div class="card-label" style="color:#00f5ff;">MODALITIES</div>
1385
+ <div class="card-row"><span class="card-dot" style="color:#00f5ff;">β—ˆ</span>Audio Waveform Analysis</div>
1386
+ <div class="card-row"><span class="card-dot" style="color:#00f5ff;">β—ˆ</span>Speech Transcription (Whisper)</div>
1387
+ <div class="card-row"><span class="card-dot" style="color:#00f5ff;">β—ˆ</span>Facial Expression Mapping</div>
1388
  </div>
1389
  </div>
1390
+ <div class="cyber-card cyber-card-purple">
1391
+ <div class="card-inner">
1392
+ <div class="card-label" style="color:#bf00ff;">NEURAL MODELS</div>
1393
+ <div class="card-row"><span class="card-dot" style="color:#bf00ff;">β—ˆ</span>Wav2Vec2 Β· BERT Β· ResNet18</div>
1394
+ <div class="card-row"><span class="card-dot" style="color:#bf00ff;">β—ˆ</span>Whisper ASR</div>
1395
+ <div class="card-row"><span class="card-dot" style="color:#bf00ff;">β—ˆ</span>Hybrid Bimodal Fusion (HBF)</div>
1396
  </div>
1397
  </div>
1398
  </div>
 
1447
  # ── About Accordion ─────────────────────────────────
1448
  with gr.Accordion("β—† SYSTEM ARCHITECTURE", open=False):
1449
 
1450
+ gr.HTML("""
1451
+ <div class="arch-grid">
1452
+ <div class="arch-section">
1453
+ <div class="arch-title">NEURAL PIPELINE</div>
1454
+ <p class="arch-desc">Three independent encoders fused through a Hybrid Bimodal Fusion (HBF) block across 6 iterative layers.</p>
1455
+ <div class="arch-row">
1456
+ <div class="arch-tag" style="border-color:#00f5ff;color:#00f5ff;">WAV2VEC2</div>
1457
+ <div class="arch-detail">Extracts deep acoustic features from raw audio waveform</div>
1458
+ </div>
1459
+ <div class="arch-row">
1460
+ <div class="arch-tag" style="border-color:#bf00ff;color:#bf00ff;">BERT</div>
1461
+ <div class="arch-detail">Understands semantic and emotional tone from transcribed speech</div>
1462
+ </div>
1463
+ <div class="arch-row">
1464
+ <div class="arch-tag" style="border-color:#00ff88;color:#00ff88;">RESNET18</div>
1465
+ <div class="arch-detail">Captures facial micro-expressions across sampled video frames</div>
1466
+ </div>
1467
+ <div class="arch-row">
1468
+ <div class="arch-tag" style="border-color:#ff6b35;color:#ff6b35;">HBF</div>
1469
+ <div class="arch-detail">Iteratively aligns all three modalities over 6 fusion layers</div>
1470
+ </div>
1471
+ </div>
1472
+ <div class="arch-section">
1473
+ <div class="arch-title">DETECTABLE EMOTIONS</div>
1474
+ <div class="emotion-chips">
1475
+ <div class="emotion-chip" style="border-color:#ff4444;color:#ff4444;box-shadow:0 0 12px rgba(255,68,68,0.2);">⚑ ANGRY</div>
1476
+ <div class="emotion-chip" style="border-color:#ffcc00;color:#ffcc00;box-shadow:0 0 12px rgba(255,204,0,0.2);">β—ˆ HAPPY</div>
1477
+ <div class="emotion-chip" style="border-color:#00f5ff;color:#00f5ff;box-shadow:0 0 12px rgba(0,245,255,0.2);">β—Ž NEUTRAL</div>
1478
+ <div class="emotion-chip" style="border-color:#7b9fff;color:#7b9fff;box-shadow:0 0 12px rgba(123,159,255,0.2);">β—‡ SAD</div>
1479
+ </div>
1480
+ </div>
1481
+ </div>
1482
  """)
1483
 
1484
  # ── Footer ──────────────────────────────────────────