Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,15 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM, AutoFeatureExtractor, SegformerForSemanticSegmentation
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
extractor = AutoFeatureExtractor.from_pretrained("nickmuchi/segformer-b4-finetuned-segments-sidewalk")
|
| 6 |
+
|
| 7 |
+
model = SegformerForSemanticSegmentation.from_pretrained("nickmuchi/segformer-b4-finetuned-segments-sidewalk")
|
| 8 |
+
|
| 9 |
+
pipe = pipeline(task="feature-extraction",
|
| 10 |
+
model=model)
|
| 11 |
+
|
| 12 |
+
gr.Interface.load(pipe,
|
| 13 |
+
title="Segformer",
|
| 14 |
+
description="Add description",
|
| 15 |
+
).launch()
|