dakkoong commited on
Commit
3fe6fac
โ€ข
1 Parent(s): 89fa28d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,10 +1,11 @@
1
  import gradio as gr
2
  import numpy as np
3
  from PIL import Image
4
- from tensorflow.keras.models import load_model
 
5
 
6
- # ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ๋ชจ๋ธ์„ ๋ถˆ๋Ÿฌ์˜ต๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์—์„œ๋Š” ๊ฐ„๋‹จํ•œ ์˜ˆ์‹œ ๋ชจ๋ธ์„ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
7
- model = load_model('nvidia/segformer-b1-finetuned-cityscapes-1024-1024') # ๋ชจ๋ธ ๊ฒฝ๋กœ๋ฅผ ์ ์ ˆํ•˜๊ฒŒ ์ˆ˜์ •ํ•˜์„ธ์š”.
8
 
9
  # ๋ชจ๋ธ ์ž…๋ ฅ ํฌ๊ธฐ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
10
  input_size = model.input_shape[1:3]
 
1
  import gradio as gr
2
  import numpy as np
3
  from PIL import Image
4
+ import tensorflow as tf
5
+ from transformers import SegformerFeatureExtractor, TFSegformerForSemanticSegmentation
6
 
7
+ feature_extractor = SegformerFeatureExtractor.from_pretrained(
8
+ "nvidia/segformer-b1-finetuned-cityscapes-1024-1024"
9
 
10
  # ๋ชจ๋ธ ์ž…๋ ฅ ํฌ๊ธฐ๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
11
  input_size = model.input_shape[1:3]