Fix ImportError by replacing MediaMode with WebRtcMode in streamlit_webrtc import and webrtc_streamer configuration
Browse files
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,
|
9 |
|
10 |
# Constants
|
11 |
NUM_FRAMES = 16
|
@@ -95,7 +95,7 @@ else:
|
|
95 |
|
96 |
webrtc_streamer(
|
97 |
key="dashcam-webcam",
|
98 |
-
mode=
|
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 |
}),
|