jatinmehra commited on
Commit
89a037c
·
verified ·
1 Parent(s): ed0f068

Fix ImportError by replacing MediaMode with WebRtcMode in streamlit_webrtc import and webrtc_streamer configuration

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ import numpy as np
5
  import torch
6
  from collections import deque
7
  from transformers import AutoFeatureExtractor, AutoModelForVideoClassification
8
- from streamlit_webrtc import webrtc_streamer, VideoTransformerBase, RTCConfiguration, MediaMode
9
 
10
  # Constants
11
  NUM_FRAMES = 16
@@ -95,7 +95,7 @@ else:
95
 
96
  webrtc_streamer(
97
  key="dashcam-webcam",
98
- mode=MediaMode.RECV, # Changed from "recv" string to MediaMode enum
99
  rtc_configuration=RTCConfiguration({
100
  "iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]
101
  }),
 
5
  import torch
6
  from collections import deque
7
  from transformers import AutoFeatureExtractor, AutoModelForVideoClassification
8
+ from streamlit_webrtc import webrtc_streamer, VideoTransformerBase, RTCConfiguration, WebRtcMode
9
 
10
  # Constants
11
  NUM_FRAMES = 16
 
95
 
96
  webrtc_streamer(
97
  key="dashcam-webcam",
98
+ mode=WebRtcMode.RECVONLY,
99
  rtc_configuration=RTCConfiguration({
100
  "iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]
101
  }),