Update app.py
Browse files
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.
|
38 |
-
outputs="
|
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 |
)
|