Spaces:
Running
Running
add more example
Browse files
app.py
CHANGED
|
@@ -139,10 +139,15 @@ def predict(img):
|
|
| 139 |
# Gradio UI (Webcam + Upload)
|
| 140 |
# ============================
|
| 141 |
ds = load_dataset("TristanKE/RemainingLifespanPredictionFaces", split="train")
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
demo = gr.Interface(
|
| 148 |
fn=predict,
|
|
@@ -151,7 +156,7 @@ demo = gr.Interface(
|
|
| 151 |
live=False,
|
| 152 |
title="Lifespan Predictor (Demo)",
|
| 153 |
description="Upload or take a face photo. Model predicts remaining lifespan (years).",
|
| 154 |
-
examples=[["
|
| 155 |
css="""
|
| 156 |
#pred-box {
|
| 157 |
height: 500px; /* fixed height to match image */
|
|
|
|
| 139 |
# Gradio UI (Webcam + Upload)
|
| 140 |
# ============================
|
| 141 |
ds = load_dataset("TristanKE/RemainingLifespanPredictionFaces", split="train")
|
| 142 |
+
sample1 = ds[1]
|
| 143 |
+
img1= sample1["image"]
|
| 144 |
+
img1.save("example1.jpg")
|
| 145 |
+
sample2 = ds[2]
|
| 146 |
+
img2= sample2["image"]
|
| 147 |
+
img2.save("example2.jpg")
|
| 148 |
+
sample3 = ds[3]
|
| 149 |
+
img3= sample3["image"]
|
| 150 |
+
img3.save("example3.jpg")
|
| 151 |
|
| 152 |
demo = gr.Interface(
|
| 153 |
fn=predict,
|
|
|
|
| 156 |
live=False,
|
| 157 |
title="Lifespan Predictor (Demo)",
|
| 158 |
description="Upload or take a face photo. Model predicts remaining lifespan (years).",
|
| 159 |
+
examples=[["example1.jpg"],["example2.jpg"],["example3.jpg"]], # π make sure example.jpg exists in repo
|
| 160 |
css="""
|
| 161 |
#pred-box {
|
| 162 |
height: 500px; /* fixed height to match image */
|