Commit
Β·
19c1c65
1
Parent(s):
ad05294
fix
Browse files- backend/gradio_labanmovementanalysis/__init__.py +12 -0
- demo/app.py +14 -6
backend/gradio_labanmovementanalysis/__init__.py
CHANGED
|
@@ -5,6 +5,14 @@ from . import notation_engine
|
|
| 5 |
from . import json_generator
|
| 6 |
from . import visualizer
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Import agent API if available
|
| 9 |
try:
|
| 10 |
from . import agent_api
|
|
@@ -22,6 +30,10 @@ __all__ = [
|
|
| 22 |
'visualizer'
|
| 23 |
]
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Add agent API to exports if available
|
| 26 |
if _has_agent_api:
|
| 27 |
__all__.extend(['agent_api', 'LabanAgentAPI', 'quick_analyze', 'analyze_and_summarize'])
|
|
|
|
| 5 |
from . import json_generator
|
| 6 |
from . import visualizer
|
| 7 |
|
| 8 |
+
# Import agentic analysis
|
| 9 |
+
try:
|
| 10 |
+
from . import agentic_analysis
|
| 11 |
+
from .agentic_analysis import generate_agentic_analysis, process_standard_for_agent
|
| 12 |
+
_has_agentic_analysis = True
|
| 13 |
+
except ImportError:
|
| 14 |
+
_has_agentic_analysis = False
|
| 15 |
+
|
| 16 |
# Import agent API if available
|
| 17 |
try:
|
| 18 |
from . import agent_api
|
|
|
|
| 30 |
'visualizer'
|
| 31 |
]
|
| 32 |
|
| 33 |
+
# Add agentic analysis to exports if available
|
| 34 |
+
if _has_agentic_analysis:
|
| 35 |
+
__all__.extend(['agentic_analysis', 'generate_agentic_analysis', 'process_standard_for_agent'])
|
| 36 |
+
|
| 37 |
# Add agent API to exports if available
|
| 38 |
if _has_agent_api:
|
| 39 |
__all__.extend(['agent_api', 'LabanAgentAPI', 'quick_analyze', 'analyze_and_summarize'])
|
demo/app.py
CHANGED
|
@@ -126,17 +126,25 @@ def process_video_for_agent(video, model, output_format="summary"):
|
|
| 126 |
|
| 127 |
# Import agentic analysis functions from backend
|
| 128 |
try:
|
|
|
|
| 129 |
from gradio_labanmovementanalysis.agentic_analysis import (
|
| 130 |
generate_agentic_analysis,
|
| 131 |
process_standard_for_agent
|
| 132 |
)
|
| 133 |
except ImportError:
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
|
| 141 |
# ββ 4. Build UI βββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 142 |
def create_demo() -> gr.Blocks:
|
|
|
|
| 126 |
|
| 127 |
# Import agentic analysis functions from backend
|
| 128 |
try:
|
| 129 |
+
# Try package import first (for installed package)
|
| 130 |
from gradio_labanmovementanalysis.agentic_analysis import (
|
| 131 |
generate_agentic_analysis,
|
| 132 |
process_standard_for_agent
|
| 133 |
)
|
| 134 |
except ImportError:
|
| 135 |
+
try:
|
| 136 |
+
# Try local backend import (for development)
|
| 137 |
+
from backend.gradio_labanmovementanalysis.agentic_analysis import (
|
| 138 |
+
generate_agentic_analysis,
|
| 139 |
+
process_standard_for_agent
|
| 140 |
+
)
|
| 141 |
+
except ImportError:
|
| 142 |
+
# Fallback if backend module is not available
|
| 143 |
+
def generate_agentic_analysis(json_data, analysis_type, filter_direction="any", filter_intensity="any", filter_min_fluidity=0.0, filter_min_expansion=0.0):
|
| 144 |
+
return {"error": "Agentic analysis backend not available"}
|
| 145 |
+
|
| 146 |
+
def process_standard_for_agent(json_data, output_format="summary"):
|
| 147 |
+
return {"error": "Agent conversion backend not available"}
|
| 148 |
|
| 149 |
# ββ 4. Build UI βββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 150 |
def create_demo() -> gr.Blocks:
|