Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,24 @@
|
|
1 |
-
import
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import cv2
|
2 |
+
import numpy as np
|
3 |
+
import av
|
4 |
+
import mediapipe as mp
|
5 |
+
from streamlit_webrtc import webrtc_streamer, WebRtcMode, RTCConfiguration
|
6 |
|
7 |
+
mp_drawing = mp.solutions.drawing_utils
|
8 |
+
mp_drawing_styles = mp.solutions.drawing_styles
|
9 |
+
mp_hands = mp.solutions.hands
|
10 |
+
hands = mp_hands.Hands(
|
11 |
+
model_complexity=0,
|
12 |
+
min_detection_confidence=0.5,
|
13 |
+
min_tracking_confidence=0.5
|
14 |
+
)
|
15 |
+
RTC_CONFIGURATION = RTCConfiguration(
|
16 |
+
{"iceServers": [{"urls": ["stun:stun.l.google.com:19302"]}]}
|
17 |
+
)
|
18 |
+
webrtc_ctx = webrtc_streamer(
|
19 |
+
key="TEST",
|
20 |
+
mode=WebRtcMode.SENDRECV,
|
21 |
+
rtc_configuration=RTC_CONFIGURATION,
|
22 |
+
media_stream_constraints={"video": True, "audio": False},
|
23 |
+
async_processing=True,
|
24 |
+
)
|