englissi commited on
Commit
7c4faa5
ยท
verified ยท
1 Parent(s): dc5230d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -3,7 +3,6 @@ from transformers import AutoImageProcessor, BeitForSemanticSegmentation
3
  from PIL import Image
4
  import torch
5
  import numpy as np
6
- import matplotlib.pyplot as plt
7
 
8
  # ๋ชจ๋ธ๊ณผ ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ๋ฅผ ๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.
9
  processor = AutoImageProcessor.from_pretrained("microsoft/beit-base-finetuned-ade-640-640")
@@ -34,8 +33,8 @@ def predict(image):
34
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์„ค์ •
35
  gr_interface = gr.Interface(
36
  fn=predict,
37
- inputs=gr.inputs.Image(type="pil"),
38
- outputs="image",
39
  title="Image Segmentation with BEiT",
40
  description="Upload an image to perform segmentation using the microsoft/beit-base-finetuned-ade-640-640 model."
41
  )
 
3
  from PIL import Image
4
  import torch
5
  import numpy as np
 
6
 
7
  # ๋ชจ๋ธ๊ณผ ์ด๋ฏธ์ง€ ํ”„๋กœ์„ธ์„œ๋ฅผ ๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.
8
  processor = AutoImageProcessor.from_pretrained("microsoft/beit-base-finetuned-ade-640-640")
 
33
  # Gradio ์ธํ„ฐํŽ˜์ด์Šค ์„ค์ •
34
  gr_interface = gr.Interface(
35
  fn=predict,
36
+ inputs=gr.Image(type="pil"),
37
+ outputs=gr.Image(type="pil"),
38
  title="Image Segmentation with BEiT",
39
  description="Upload an image to perform segmentation using the microsoft/beit-base-finetuned-ade-640-640 model."
40
  )