Spaces:
Running
Running
Fixed plant description text
#1
by AntoineR974 - opened
app.py
CHANGED
|
@@ -226,12 +226,17 @@ def on_plant_selected(evt: gr.SelectData, user_id: str) -> str:
|
|
| 226 |
if photo_path.exists():
|
| 227 |
photo_md = f"})\n\n"
|
| 228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
return f"""
|
| 230 |
-
{photo_md}## ๐ฟ {p['genus']}
|
| 231 |
|
| 232 |
| Confidence | Sunlight | Soil | Watering |
|
| 233 |
|------------|----------|------|----------|
|
| 234 |
-
| {p['confidence']}% | {p.get('sunlight','โ')} | {p.get('soil','โ')} | {p.get('watering_frequency_days','โ')}
|
| 235 |
|
| 236 |
| Added | Last Watered |
|
| 237 |
|--------|-------------|
|
|
|
|
| 226 |
if photo_path.exists():
|
| 227 |
photo_md = f"})\n\n"
|
| 228 |
|
| 229 |
+
plant = Plant(p["genus"])
|
| 230 |
+
if plant.plant_name is not None:
|
| 231 |
+
name = plant.plant_name
|
| 232 |
+
else:
|
| 233 |
+
name = p["genus"]
|
| 234 |
return f"""
|
| 235 |
+
{photo_md}## ๐ฟ {name} ({p['genus']})
|
| 236 |
|
| 237 |
| Confidence | Sunlight | Soil | Watering |
|
| 238 |
|------------|----------|------|----------|
|
| 239 |
+
| {p['confidence']}% | {p.get('sunlight','โ')} | {p.get('soil','โ')} | {p.get('watering_frequency_days','โ')} |
|
| 240 |
|
| 241 |
| Added | Last Watered |
|
| 242 |
|--------|-------------|
|