Update app.py
Browse files
app.py
CHANGED
@@ -210,6 +210,12 @@ st.info("Use your webcam for real-time squat detection.")
|
|
210 |
mp_pose = mp.solutions.pose
|
211 |
mp_drawing = mp.solutions.drawing_utils
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
# Angle calculation function
|
214 |
def calculate_angle(a, b, c):
|
215 |
a = np.array(a)
|
@@ -238,7 +244,7 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
238 |
Detection(
|
239 |
class_id=0, # Assuming a generic class_id for pose detections
|
240 |
label="Pose",
|
241 |
-
score=
|
242 |
box=np.array([0, 0, image.shape[1], image.shape[0]]) # Full image as bounding box
|
243 |
)
|
244 |
] if landmarks else []
|
|
|
210 |
mp_pose = mp.solutions.pose
|
211 |
mp_drawing = mp.solutions.drawing_utils
|
212 |
|
213 |
+
class Detection(NamedTuple):
|
214 |
+
class_id: int
|
215 |
+
label: str
|
216 |
+
score: float
|
217 |
+
box: np.ndarray
|
218 |
+
|
219 |
# Angle calculation function
|
220 |
def calculate_angle(a, b, c):
|
221 |
a = np.array(a)
|
|
|
244 |
Detection(
|
245 |
class_id=0, # Assuming a generic class_id for pose detections
|
246 |
label="Pose",
|
247 |
+
score=0.7, # Full confidence as pose landmarks were detected
|
248 |
box=np.array([0, 0, image.shape[1], image.shape[0]]) # Full image as bounding box
|
249 |
)
|
250 |
] if landmarks else []
|