Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,7 +44,7 @@ def get_risk_level(score):
|
|
| 44 |
class UnicodePDF(FPDF):
|
| 45 |
def header(self):
|
| 46 |
self.set_font("DejaVu", "B", 16)
|
| 47 |
-
self.cell(0, 10, "
|
| 48 |
|
| 49 |
def footer(self):
|
| 50 |
self.set_y(-15)
|
|
@@ -132,7 +132,7 @@ def classify_food(image, conditions, language):
|
|
| 132 |
f"π Risk Score: {risk_score}% ({risk_level})\n"
|
| 133 |
f"β οΈ Risk Factors: {', '.join(flags) if flags else 'None'}\n"
|
| 134 |
f"β
Advice: {advice}\n\n"
|
| 135 |
-
f"π *Generated by
|
| 136 |
)
|
| 137 |
|
| 138 |
return result, audio_path, f"π£οΈ Language: {language}", pdf_path
|
|
@@ -152,7 +152,7 @@ interface = gr.Interface(
|
|
| 152 |
gr.Textbox(label="Language Info"),
|
| 153 |
gr.File(label="Download PDF Report")
|
| 154 |
],
|
| 155 |
-
title="π²
|
| 156 |
description="Upload a food image and get nutrition details, health risk, personalized advice, audio guidance, and a downloadable PDF report."
|
| 157 |
)
|
| 158 |
|
|
|
|
| 44 |
class UnicodePDF(FPDF):
|
| 45 |
def header(self):
|
| 46 |
self.set_font("DejaVu", "B", 16)
|
| 47 |
+
self.cell(0, 10, "Food Vision Report", ln=True)
|
| 48 |
|
| 49 |
def footer(self):
|
| 50 |
self.set_y(-15)
|
|
|
|
| 132 |
f"π Risk Score: {risk_score}% ({risk_level})\n"
|
| 133 |
f"β οΈ Risk Factors: {', '.join(flags) if flags else 'None'}\n"
|
| 134 |
f"β
Advice: {advice}\n\n"
|
| 135 |
+
f"π *Generated by Food Vision.*"
|
| 136 |
)
|
| 137 |
|
| 138 |
return result, audio_path, f"π£οΈ Language: {language}", pdf_path
|
|
|
|
| 152 |
gr.Textbox(label="Language Info"),
|
| 153 |
gr.File(label="Download PDF Report")
|
| 154 |
],
|
| 155 |
+
title="π² Food Vision",
|
| 156 |
description="Upload a food image and get nutrition details, health risk, personalized advice, audio guidance, and a downloadable PDF report."
|
| 157 |
)
|
| 158 |
|