Spaces:
Runtime error
Runtime error
Commit ·
abf5f25
1
Parent(s): f1eecad
added examples
Browse files- app.py +3 -1
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 172851.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 172920.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 172933.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173022.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173129.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173221.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173242.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173252.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173720.png +0 -0
- examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173759.png +0 -0
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from PIL import Image
|
|
| 4 |
import torch
|
| 5 |
from torch import nn
|
| 6 |
import timm
|
| 7 |
-
|
| 8 |
|
| 9 |
|
| 10 |
title = "Age-PT"
|
|
@@ -46,12 +46,14 @@ def predict(img):
|
|
| 46 |
fps = 1 / elapsed_time
|
| 47 |
return pred_age, fps
|
| 48 |
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
demo = gr.Interface(fn=predict,
|
| 52 |
inputs=gr.Image(type="pil"),
|
| 53 |
outputs=[gr.Number(label="Age Prediction"),
|
| 54 |
gr.Number(label="Prediction speed (fps)")],
|
|
|
|
| 55 |
title=title,
|
| 56 |
description=description,
|
| 57 |
article=article)
|
|
|
|
| 4 |
import torch
|
| 5 |
from torch import nn
|
| 6 |
import timm
|
| 7 |
+
import os
|
| 8 |
|
| 9 |
|
| 10 |
title = "Age-PT"
|
|
|
|
| 46 |
fps = 1 / elapsed_time
|
| 47 |
return pred_age, fps
|
| 48 |
|
| 49 |
+
example_list = [["examples/" + example] for example in os.listdir("examples")]
|
| 50 |
|
| 51 |
|
| 52 |
demo = gr.Interface(fn=predict,
|
| 53 |
inputs=gr.Image(type="pil"),
|
| 54 |
outputs=[gr.Number(label="Age Prediction"),
|
| 55 |
gr.Number(label="Prediction speed (fps)")],
|
| 56 |
+
examples=example_list,
|
| 57 |
title=title,
|
| 58 |
description=description,
|
| 59 |
article=article)
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 172851.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 172920.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 172933.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173022.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173129.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173221.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173242.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173252.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173720.png
ADDED
|
examples//354/212/244/355/201/254/353/246/260/354/203/267 2024-10-06 173759.png
ADDED
|