Commit
·
5dae8c3
1
Parent(s):
57ca54b
commented the logs
Browse files
backend/gradio_labanmovementanalysis/labanmovementanalysis.py
CHANGED
|
@@ -51,7 +51,7 @@ class LabanMovementAnalysis(Component):
|
|
| 51 |
elem_classes: Optional[List[str]] = None,
|
| 52 |
render: bool = True,
|
| 53 |
**kwargs):
|
| 54 |
-
print("[TRACE] LabanMovementAnalysis.__init__ called")
|
| 55 |
"""
|
| 56 |
Initialize the Laban Movement Analysis component.
|
| 57 |
|
|
@@ -90,7 +90,7 @@ class LabanMovementAnalysis(Component):
|
|
| 90 |
# SkateFormer features reserved for Version 2
|
| 91 |
|
| 92 |
def preprocess(self, payload: Dict[str, Any]) -> Dict[str, Any]:
|
| 93 |
-
print("[TRACE] LabanMovementAnalysis.preprocess called")
|
| 94 |
"""
|
| 95 |
Preprocess input from the frontend.
|
| 96 |
|
|
@@ -128,7 +128,7 @@ class LabanMovementAnalysis(Component):
|
|
| 128 |
return options
|
| 129 |
|
| 130 |
def postprocess(self, value: Any) -> Dict[str, Any]:
|
| 131 |
-
print("[TRACE] LabanMovementAnalysis.postprocess called")
|
| 132 |
"""
|
| 133 |
Postprocess analysis results for the frontend.
|
| 134 |
|
|
@@ -156,7 +156,7 @@ class LabanMovementAnalysis(Component):
|
|
| 156 |
def process_video(self, video_input: Union[str, os.PathLike], model: str = DEFAULT_MODEL,
|
| 157 |
enable_visualization: bool = True,
|
| 158 |
include_keypoints: bool = False) -> Tuple[Dict[str, Any], Optional[str]]:
|
| 159 |
-
print(f"[TRACE] LabanMovementAnalysis.process_video called with model={model}, enable_visualization={enable_visualization}, include_keypoints={include_keypoints}")
|
| 160 |
"""
|
| 161 |
Main processing function that performs pose analysis on a video.
|
| 162 |
|
|
@@ -270,7 +270,7 @@ class LabanMovementAnalysis(Component):
|
|
| 270 |
return json_output, visualization_path
|
| 271 |
|
| 272 |
def __call__(self, video_path: str, **kwargs) -> Tuple[Dict[str, Any], Optional[str]]:
|
| 273 |
-
print(f"[TRACE] LabanMovementAnalysis.__call__ called with video_path={video_path}")
|
| 274 |
"""
|
| 275 |
Make the component callable for easy use.
|
| 276 |
|
|
@@ -290,14 +290,14 @@ class LabanMovementAnalysis(Component):
|
|
| 290 |
# will be available in the next major release
|
| 291 |
|
| 292 |
def cleanup(self):
|
| 293 |
-
print("[TRACE] LabanMovementAnalysis.cleanup called")
|
| 294 |
"""Clean up temporary files and resources."""
|
| 295 |
# Clean up video input handler
|
| 296 |
if hasattr(self, 'video_input'):
|
| 297 |
self.video_input.cleanup()
|
| 298 |
|
| 299 |
def example_payload(self) -> Dict[str, Any]:
|
| 300 |
-
print("[TRACE] LabanMovementAnalysis.example_payload called")
|
| 301 |
"""Example input payload for documentation."""
|
| 302 |
return {
|
| 303 |
"video": {"path": "/path/to/video.mp4"},
|
|
@@ -307,7 +307,7 @@ class LabanMovementAnalysis(Component):
|
|
| 307 |
}
|
| 308 |
|
| 309 |
def example_value(self) -> Dict[str, Any]:
|
| 310 |
-
print("[TRACE] LabanMovementAnalysis.example_value called")
|
| 311 |
"""Example output value for documentation."""
|
| 312 |
return {
|
| 313 |
"json_output": {
|
|
@@ -356,7 +356,7 @@ class LabanMovementAnalysis(Component):
|
|
| 356 |
}
|
| 357 |
|
| 358 |
def api_info(self) -> Dict[str, Any]:
|
| 359 |
-
print("[TRACE] LabanMovementAnalysis.api_info called")
|
| 360 |
"""API information for the component."""
|
| 361 |
return {
|
| 362 |
"type": "composite",
|
|
|
|
| 51 |
elem_classes: Optional[List[str]] = None,
|
| 52 |
render: bool = True,
|
| 53 |
**kwargs):
|
| 54 |
+
# print("[TRACE] LabanMovementAnalysis.__init__ called")
|
| 55 |
"""
|
| 56 |
Initialize the Laban Movement Analysis component.
|
| 57 |
|
|
|
|
| 90 |
# SkateFormer features reserved for Version 2
|
| 91 |
|
| 92 |
def preprocess(self, payload: Dict[str, Any]) -> Dict[str, Any]:
|
| 93 |
+
# print("[TRACE] LabanMovementAnalysis.preprocess called")
|
| 94 |
"""
|
| 95 |
Preprocess input from the frontend.
|
| 96 |
|
|
|
|
| 128 |
return options
|
| 129 |
|
| 130 |
def postprocess(self, value: Any) -> Dict[str, Any]:
|
| 131 |
+
# print("[TRACE] LabanMovementAnalysis.postprocess called")
|
| 132 |
"""
|
| 133 |
Postprocess analysis results for the frontend.
|
| 134 |
|
|
|
|
| 156 |
def process_video(self, video_input: Union[str, os.PathLike], model: str = DEFAULT_MODEL,
|
| 157 |
enable_visualization: bool = True,
|
| 158 |
include_keypoints: bool = False) -> Tuple[Dict[str, Any], Optional[str]]:
|
| 159 |
+
# print(f"[TRACE] LabanMovementAnalysis.process_video called with model={model}, enable_visualization={enable_visualization}, include_keypoints={include_keypoints}")
|
| 160 |
"""
|
| 161 |
Main processing function that performs pose analysis on a video.
|
| 162 |
|
|
|
|
| 270 |
return json_output, visualization_path
|
| 271 |
|
| 272 |
def __call__(self, video_path: str, **kwargs) -> Tuple[Dict[str, Any], Optional[str]]:
|
| 273 |
+
# print(f"[TRACE] LabanMovementAnalysis.__call__ called with video_path={video_path}")
|
| 274 |
"""
|
| 275 |
Make the component callable for easy use.
|
| 276 |
|
|
|
|
| 290 |
# will be available in the next major release
|
| 291 |
|
| 292 |
def cleanup(self):
|
| 293 |
+
# print("[TRACE] LabanMovementAnalysis.cleanup called")
|
| 294 |
"""Clean up temporary files and resources."""
|
| 295 |
# Clean up video input handler
|
| 296 |
if hasattr(self, 'video_input'):
|
| 297 |
self.video_input.cleanup()
|
| 298 |
|
| 299 |
def example_payload(self) -> Dict[str, Any]:
|
| 300 |
+
# print("[TRACE] LabanMovementAnalysis.example_payload called")
|
| 301 |
"""Example input payload for documentation."""
|
| 302 |
return {
|
| 303 |
"video": {"path": "/path/to/video.mp4"},
|
|
|
|
| 307 |
}
|
| 308 |
|
| 309 |
def example_value(self) -> Dict[str, Any]:
|
| 310 |
+
# print("[TRACE] LabanMovementAnalysis.example_value called")
|
| 311 |
"""Example output value for documentation."""
|
| 312 |
return {
|
| 313 |
"json_output": {
|
|
|
|
| 356 |
}
|
| 357 |
|
| 358 |
def api_info(self) -> Dict[str, Any]:
|
| 359 |
+
# print("[TRACE] LabanMovementAnalysis.api_info called")
|
| 360 |
"""API information for the component."""
|
| 361 |
return {
|
| 362 |
"type": "composite",
|
backend/gradio_labanmovementanalysis/pose_estimation.py
CHANGED
|
@@ -444,7 +444,7 @@ def _safe_pose_from_dets(dets: List[PoseResult], frame_idx: int) -> List[PoseRes
|
|
| 444 |
"""
|
| 445 |
# This function is currently not used in the provided codebase.
|
| 446 |
# If it were to be used, it would need proper integration.
|
| 447 |
-
print(f"[DEBUG] _safe_pose_from_dets called for frame {frame_idx}, but is not currently integrated.")
|
| 448 |
safe_poses = []
|
| 449 |
missing_mask = []
|
| 450 |
prev_pose = None
|
|
|
|
| 444 |
"""
|
| 445 |
# This function is currently not used in the provided codebase.
|
| 446 |
# If it were to be used, it would need proper integration.
|
| 447 |
+
# print(f"[DEBUG] _safe_pose_from_dets called for frame {frame_idx}, but is not currently integrated.")
|
| 448 |
safe_poses = []
|
| 449 |
missing_mask = []
|
| 450 |
prev_pose = None
|