Spaces:
No application file
No application file
Upload app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from src.analysis.chart_processor import ChartProcessor
|
3 |
from src.analysis.pattern_generator import PatternGenerator
|
@@ -15,6 +20,10 @@ def analyze_full_chart(chart_image, symbol):
|
|
15 |
indicator_gen = IndicatorGenerator()
|
16 |
indicator_charts = indicator_gen.generate_all_indicators(historical_data)
|
17 |
|
|
|
|
|
|
|
|
|
18 |
analyzer = ChartAnalyzer()
|
19 |
analysis_results = analyzer.analyze_full(
|
20 |
chart_image=chart_image,
|
@@ -27,7 +36,8 @@ def analyze_full_chart(chart_image, symbol):
|
|
27 |
'pattern_analysis': analysis_results.patterns,
|
28 |
'indicator_analysis': analysis_results.indicators,
|
29 |
'predictions': analysis_results.predictions,
|
30 |
-
'interactive_charts': indicator_charts
|
|
|
31 |
}
|
32 |
|
33 |
interface = gr.Interface(
|
|
|
1 |
+
import sys
|
2 |
+
import os
|
3 |
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
4 |
+
project_root = os.path.dirname(current_dir)
|
5 |
+
sys.path.append(project_root)
|
6 |
import gradio as gr
|
7 |
from src.analysis.chart_processor import ChartProcessor
|
8 |
from src.analysis.pattern_generator import PatternGenerator
|
|
|
20 |
indicator_gen = IndicatorGenerator()
|
21 |
indicator_charts = indicator_gen.generate_all_indicators(historical_data)
|
22 |
|
23 |
+
|
24 |
+
processor = ChartProcessor()
|
25 |
+
results = processor.process_chart(chart_image)
|
26 |
+
|
27 |
analyzer = ChartAnalyzer()
|
28 |
analysis_results = analyzer.analyze_full(
|
29 |
chart_image=chart_image,
|
|
|
36 |
'pattern_analysis': analysis_results.patterns,
|
37 |
'indicator_analysis': analysis_results.indicators,
|
38 |
'predictions': analysis_results.predictions,
|
39 |
+
'interactive_charts': indicator_charts,
|
40 |
+
'chart_analysis':results,
|
41 |
}
|
42 |
|
43 |
interface = gr.Interface(
|