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