Spaces:
Build error
Build error
Regino commited on
Commit ·
60845fc
1
Parent(s): a876981
fs
Browse filesFiles changed (2)
- src/streamlit_app.py+12-9
- train.ipynbAdded
133 unmodified lines13413513613713813910 unmodified lines1501511521531541551561571581591601611621631641653 unmodified lines169170171172173174175176177178179180133 unmodified lines# Convert the processed BGR image back to RGB for Streamlit/WebRTC displayreturn cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB)# --- 4. Streamlit App Layout and WebRTC Stream ---st.title("Live Facial Emotion Recognition")10 unmodified linesvideo_processor_factory=lambda: EmotionDetector(model, face_detector),media_stream_constraints={"video": True, "audio": False}, # Only video, no audio# Temporarily set async_processing to False for debugging.# If this works, it points to an asyncio interaction issue. For better performance,# you'd ideally re-enable async_processing=True later.async_processing=False,# Optional: tries to auto-start. Can comment out if you prefer manual start.# desired_playing_state={"playing": True},# --- ENHANCED RTC CONFIGURATION ---# Providing a robust list of public STUN servers for better NAT traversalrtc_configuration={"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]},3 unmodified lines{"urls": ["stun:stun4.l.google.com:19302"]},{"urls": ["stun:stun.services.mozilla.com"]},{"urls": ["stun:global.stun.twilio.com:3478"]},{"urls": ["stun:stun.nextcloud.com:3478"]}, # Added another{"urls": ["stun:stun.schlund.de"]}, # Added another]},# For more detailed debugging in the browser console, uncomment the line below.# log_level="debug",)# Provide feedback based on the stream state133 unmodified lines13413513613713813914014114214310 unmodified lines1541551561571581591601611621631641651663 unmodified lines170171172173174175176177178179180181182183133 unmodified lines# Convert the processed BGR image back to RGB for Streamlit/WebRTC displayreturn cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB)# app.py# ... (previous code above) ...# --- 4. Streamlit App Layout and WebRTC Stream ---st.title("Live Facial Emotion Recognition")10 unmodified linesvideo_processor_factory=lambda: EmotionDetector(model, face_detector),media_stream_constraints={"video": True, "audio": False}, # Only video, no audioasync_processing=False, # Keep this False for now to avoid asyncio errors# Optional: tries to auto-start. Can comment out if you prefer manual start.# desired_playing_state={"playing": True},# --- ENHANCED RTC CONFIGURATION ---# Providing a very robust list of public STUN servers for better NAT traversalrtc_configuration={"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]},3 unmodified lines{"urls": ["stun:stun4.l.google.com:19302"]},{"urls": ["stun:stun.services.mozilla.com"]},{"urls": ["stun:global.stun.twilio.com:3478"]},{"urls": ["stun:stun.nextcloud.com:3478"]},{"urls": ["stun:stun.schlund.de"]},{"urls": ["stun:stun.stunprotocol.org"]}, # Added another{"urls": ["stun:stunserver.org"]}, # Added another]},# --- Enable Debug Logging ---log_level="debug", # <--- CRITICAL FOR DIAGNOSIS)# Provide feedback based on the stream state
src/streamlit_app.py+12-9
train.ipynbAdded