Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ import numpy as np
|
|
| 11 |
import cv2
|
| 12 |
from PIL import Image
|
| 13 |
|
| 14 |
-
MODEL_PATH = r"pose_landmarker_lite.task"
|
| 15 |
|
| 16 |
# Drawing landmarks
|
| 17 |
# def draw_landmarks_on_image(rgb_image, detection_result):
|
|
@@ -41,7 +41,7 @@ MODEL_PATH = r"pose_landmarker_lite.task"
|
|
| 41 |
|
| 42 |
def detection(image, conf_threshold=0.3):
|
| 43 |
frame = cv2.flip(image, 1)
|
| 44 |
-
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 45 |
|
| 46 |
rgb_frame=cv2.circle(rgb_frame,(90,90),(255,0,0),20)
|
| 47 |
# mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=rgb_frame)
|
|
@@ -56,7 +56,7 @@ def detection(image, conf_threshold=0.3):
|
|
| 56 |
|
| 57 |
|
| 58 |
with gr.Blocks() as demo:
|
| 59 |
-
image = WebRTC(label="Stream", mode="send-receive", modality="video", height=480, width=640,
|
| 60 |
conf_threshold = gr.Slider(
|
| 61 |
label="Confidence Threshold",
|
| 62 |
minimum=0.0,
|
|
|
|
| 11 |
import cv2
|
| 12 |
from PIL import Image
|
| 13 |
|
| 14 |
+
# MODEL_PATH = r"pose_landmarker_lite.task"
|
| 15 |
|
| 16 |
# Drawing landmarks
|
| 17 |
# def draw_landmarks_on_image(rgb_image, detection_result):
|
|
|
|
| 41 |
|
| 42 |
def detection(image, conf_threshold=0.3):
|
| 43 |
frame = cv2.flip(image, 1)
|
| 44 |
+
# rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
|
| 45 |
|
| 46 |
rgb_frame=cv2.circle(rgb_frame,(90,90),(255,0,0),20)
|
| 47 |
# mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=rgb_frame)
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
with gr.Blocks() as demo:
|
| 59 |
+
image = WebRTC(label="Stream", mode="send-receive", modality="video", height=480, width=640, time_limit=10)
|
| 60 |
conf_threshold = gr.Slider(
|
| 61 |
label="Confidence Threshold",
|
| 62 |
minimum=0.0,
|