Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,7 +81,7 @@ def predict(image, model, face_detector, device, margin=0.4, input_size=224):
|
|
| 81 |
# draw results
|
| 82 |
for age, d in zip(predicted_ages, detected):
|
| 83 |
draw_label(image, (d.left(), d.top()), f"{int(age)}")
|
| 84 |
-
return image
|
| 85 |
|
| 86 |
|
| 87 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
@@ -100,6 +100,7 @@ with gr.Blocks(css="style.css") as demo:
|
|
| 100 |
run_button = gr.Button("Run")
|
| 101 |
with gr.Column():
|
| 102 |
result = gr.Image(label="Result")
|
|
|
|
| 103 |
|
| 104 |
gr.Examples(
|
| 105 |
examples=examples,
|
|
|
|
| 81 |
# draw results
|
| 82 |
for age, d in zip(predicted_ages, detected):
|
| 83 |
draw_label(image, (d.left(), d.top()), f"{int(age)}")
|
| 84 |
+
return image, str(predicted_ages)
|
| 85 |
|
| 86 |
|
| 87 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 100 |
run_button = gr.Button("Run")
|
| 101 |
with gr.Column():
|
| 102 |
result = gr.Image(label="Result")
|
| 103 |
+
digits = gr.Textbox()
|
| 104 |
|
| 105 |
gr.Examples(
|
| 106 |
examples=examples,
|