Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import cv2
|
|
3 |
from gradio_webrtc import WebRTC
|
4 |
import mediapipe as mp
|
5 |
import time
|
|
|
6 |
|
7 |
# 初始化 MediaPipe Hands
|
8 |
mp_hands = mp.solutions.hands
|
@@ -19,6 +20,7 @@ rtc_configuration = {
|
|
19 |
last_process_time = time.time()
|
20 |
|
21 |
# 手势检测函数
|
|
|
22 |
def detection(image, conf_threshold=0.5):
|
23 |
"""
|
24 |
使用 MediaPipe Hands 进行手势检测。
|
|
|
3 |
from gradio_webrtc import WebRTC
|
4 |
import mediapipe as mp
|
5 |
import time
|
6 |
+
import space
|
7 |
|
8 |
# 初始化 MediaPipe Hands
|
9 |
mp_hands = mp.solutions.hands
|
|
|
20 |
last_process_time = time.time()
|
21 |
|
22 |
# 手势检测函数
|
23 |
+
@spaces.GPU
|
24 |
def detection(image, conf_threshold=0.5):
|
25 |
"""
|
26 |
使用 MediaPipe Hands 进行手势检测。
|