Spaces:
Running
on
Zero
Running
on
Zero
File size: 2,300 Bytes
e49993e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
"""
Test script to verify the Laban Movement Analysis component structure.
"""
import sys
from pathlib import Path
# Add parent directory to path
sys.path.insert(0, str(Path(__file__).parent.parent / "backend"))
# Test imports
try:
from gradio_labanmovementanalysis import LabanMovementAnalysis
print("β LabanMovementAnalysis component imported successfully")
from gradio_labanmovementanalysis import video_utils
print("β video_utils module imported successfully")
from gradio_labanmovementanalysis import pose_estimation
print("β pose_estimation module imported successfully")
from gradio_labanmovementanalysis import notation_engine
print("β notation_engine module imported successfully")
from gradio_labanmovementanalysis import json_generator
print("β json_generator module imported successfully")
from gradio_labanmovementanalysis import visualizer
print("β visualizer module imported successfully")
except ImportError as e:
print(f"β Import error: {e}")
sys.exit(1)
# Test component instantiation
try:
component = LabanMovementAnalysis()
print("\nβ Component instantiated successfully")
# Test component methods
example_payload = component.example_payload()
print(f"β Example payload: {example_payload}")
example_value = component.example_value()
print(f"β Example value keys: {list(example_value.keys())}")
api_info = component.api_info()
print(f"β API info type: {api_info['type']}")
except Exception as e:
print(f"β Component error: {e}")
sys.exit(1)
# Test data structures
try:
from gradio_labanmovementanalysis.pose_estimation import Keypoint, PoseResult
kp = Keypoint(x=0.5, y=0.5, confidence=0.9, name="nose")
print(f"\nβ Keypoint created: {kp}")
from gradio_labanmovementanalysis.notation_engine import Direction, Speed, Intensity
print(f"β Direction values: {[d.value for d in Direction]}")
print(f"β Speed values: {[s.value for s in Speed]}")
print(f"β Intensity values: {[i.value for i in Intensity]}")
except Exception as e:
print(f"β Data structure error: {e}")
sys.exit(1)
print("\nβ
All tests passed! The component is properly structured.") |