chariscait commited on
Commit
052447e
·
verified ·
1 Parent(s): 8c890dd

Add language selector + anger support

Browse files
Files changed (1) hide show
  1. app.py +35 -2
app.py CHANGED
@@ -487,7 +487,7 @@ def show_landing_page():
487
  '<div style="text-align: center; margin-top: 40px; color: #6B7B9D; font-size: 12px;">'
488
  '<p>EmoSphere v1.0 by '
489
  '<a href="mailto:info@caitcore.com" style="color: #00D4FF;">CAIT</a></p>'
490
- '<p>No anger detection &bull; No medical screening &bull; No surveillance</p>'
491
  '</div>',
492
  unsafe_allow_html=True,
493
  )
@@ -631,6 +631,38 @@ def show_demo():
631
  "4. Click **Stop & View Report** when done"
632
  )
633
  st.divider()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
634
  st.markdown("### Modalities")
635
  st.markdown(
636
  "🧑 **Face** — ViT expression \n"
@@ -739,7 +771,8 @@ def _show_live_session(processor, remaining, start):
739
  try:
740
  audio_b64 = data_url.split(",", 1)[1]
741
  audio_bytes = base64.b64decode(audio_b64)
742
- processor.process_audio_bytes(audio_bytes)
 
743
  except Exception as e:
744
  print(f"[App] Audio decode error: {e}")
745
 
 
487
  '<div style="text-align: center; margin-top: 40px; color: #6B7B9D; font-size: 12px;">'
488
  '<p>EmoSphere v1.0 by '
489
  '<a href="mailto:info@caitcore.com" style="color: #00D4FF;">CAIT</a></p>'
490
+ '<p>No surveillance &bull; No medical screening &bull; No data storage</p>'
491
  '</div>',
492
  unsafe_allow_html=True,
493
  )
 
631
  "4. Click **Stop & View Report** when done"
632
  )
633
  st.divider()
634
+ st.markdown("### Language")
635
+ lang_options = {
636
+ "Auto-detect": None,
637
+ "English": "en",
638
+ "Greek": "el",
639
+ "Spanish": "es",
640
+ "French": "fr",
641
+ "German": "de",
642
+ "Italian": "it",
643
+ "Portuguese": "pt",
644
+ "Dutch": "nl",
645
+ "Russian": "ru",
646
+ "Chinese": "zh",
647
+ "Japanese": "ja",
648
+ "Korean": "ko",
649
+ "Arabic": "ar",
650
+ "Turkish": "tr",
651
+ "Polish": "pl",
652
+ "Swedish": "sv",
653
+ "Romanian": "ro",
654
+ "Bulgarian": "bg",
655
+ "Serbian": "sr",
656
+ "Croatian": "hr",
657
+ }
658
+ selected_lang = st.selectbox(
659
+ "Speech language",
660
+ options=list(lang_options.keys()),
661
+ index=0,
662
+ key="speech_language",
663
+ )
664
+ st.session_state["whisper_language"] = lang_options[selected_lang]
665
+ st.divider()
666
  st.markdown("### Modalities")
667
  st.markdown(
668
  "🧑 **Face** — ViT expression \n"
 
771
  try:
772
  audio_b64 = data_url.split(",", 1)[1]
773
  audio_bytes = base64.b64decode(audio_b64)
774
+ whisper_lang = st.session_state.get("whisper_language", None)
775
+ processor.process_audio_bytes(audio_bytes, language=whisper_lang)
776
  except Exception as e:
777
  print(f"[App] Audio decode error: {e}")
778