Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline, AutoFeatureExtractor,
|
| 3 |
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
-
model.eval()
|
| 9 |
-
pipe = pipeline(task="image-segmentation",
|
| 10 |
model=model,
|
| 11 |
-
feature_extractor=extractor)
|
| 12 |
|
| 13 |
gr.Interface.load(pipe,
|
| 14 |
-
title="
|
| 15 |
description="Add description",
|
| 16 |
).launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline, AutoFeatureExtractor, AutoModelForImageClassification
|
| 3 |
|
| 4 |
+
extractor = AutoFeatureExtractor.from_pretrained("nateraw/vit-age-classifier")
|
| 5 |
|
| 6 |
+
model = AutoModelForImageClassification.from_pretrained("nateraw/vit-age-classifier")
|
| 7 |
|
| 8 |
+
pipe = pipeline(task="image-classification",
|
|
|
|
|
|
|
| 9 |
model=model,
|
| 10 |
+
feature_extractor=extractor,)
|
| 11 |
|
| 12 |
gr.Interface.load(pipe,
|
| 13 |
+
title="age class",
|
| 14 |
description="Add description",
|
| 15 |
).launch()
|