doinglean commited on
Commit
d0e76dd
·
verified ·
1 Parent(s): 0835b33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -111,4 +111,18 @@ def analyze_image(image, prompt):
111
  return {"prompt": prompt, "description": "Error analyzing candles. Try a clearer screenshot with visible candles and prices."}
112
 
113
  else:
114
- return {"prompt": prompt, "description": "Unsupported prompt. Use 'Was siehst du auf dem Bild?' or 'List last 8 candles with their colors'."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  return {"prompt": prompt, "description": "Error analyzing candles. Try a clearer screenshot with visible candles and prices."}
112
 
113
  else:
114
+ return {"prompt": prompt, "description": "Unsupported prompt. Use 'Was siehst du auf dem Bild?' or 'List last 8 candles with their colors'."}
115
+
116
+ # Erstelle Gradio-Schnittstelle
117
+ iface = gr.Interface(
118
+ fn=analyze_image,
119
+ inputs=[
120
+ gr.Image(type="pil", label="Upload an Image"),
121
+ gr.Textbox(label="Prompt", placeholder="Enter your prompt, e.g., 'Was siehst du auf dem Bild?' or 'List last 8 candles with their colors'")
122
+ ],
123
+ outputs="json",
124
+ title="Chart Analysis with YOLOv8 and EasyOCR",
125
+ description="Upload a TradingView screenshot to analyze candlesticks or get a general description."
126
+ )
127
+
128
+ iface.launch()