Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,9 @@ feature_extractor = SegformerFeatureExtractor.from_pretrained(
|
|
8 |
"nvidia/segformer-b1-finetuned-cityscapes-1024-1024")
|
9 |
|
10 |
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
11 |
-
"nvidia/segformer-b1-finetuned-cityscapes-1024-1024"
|
12 |
-
|
|
|
13 |
|
14 |
# 모델 입력 크기를 확인합니다.
|
15 |
input_size = model.input_shape[1:3]
|
@@ -32,7 +33,8 @@ def classify_image(img):
|
|
32 |
|
33 |
# Gradio UI를 생성합니다.
|
34 |
iface = gr.Interface(fn=classify_image,
|
35 |
-
inputs=gr.Image(shape=(800, 600)),
|
|
|
36 |
outputs="label", live=True)
|
37 |
|
38 |
# Gradio UI를 시작합니다.
|
|
|
8 |
"nvidia/segformer-b1-finetuned-cityscapes-1024-1024")
|
9 |
|
10 |
model = TFSegformerForSemanticSegmentation.from_pretrained(
|
11 |
+
"nvidia/segformer-b1-finetuned-cityscapes-1024-1024")
|
12 |
+
|
13 |
+
|
14 |
|
15 |
# 모델 입력 크기를 확인합니다.
|
16 |
input_size = model.input_shape[1:3]
|
|
|
33 |
|
34 |
# Gradio UI를 생성합니다.
|
35 |
iface = gr.Interface(fn=classify_image,
|
36 |
+
inputs=gr.Image(shape=(800, 600)),
|
37 |
+
examples=["cityoutdoor-1.jpg", "cityoutdoor-2.jpg", "cityoutdoor-3.jpg"],
|
38 |
outputs="label", live=True)
|
39 |
|
40 |
# Gradio UI를 시작합니다.
|