Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from rembg import remove
|
2 |
+
import gradio as gr
|
3 |
+
from PIL import Image
|
4 |
+
import io
|
5 |
+
|
6 |
+
# Arka planı temizleme fonksiyonu
|
7 |
+
def remove_background(image):
|
8 |
+
output = remove(image)
|
9 |
+
return output
|
10 |
+
|
11 |
+
# Gradio arayüzü
|
12 |
+
interface = gr.Interface(
|
13 |
+
fn=remove_background,
|
14 |
+
inputs=gr.Image(type="pil", label="Görsel Yükle"),
|
15 |
+
outputs=gr.Image(type="pil", label="Arka Planı Temizlenmiş Görsel"),
|
16 |
+
title="Arka Plan Temizleme Uygulaması",
|
17 |
+
description="Bir görsel yükleyin ve arka planını otomatik olarak temizleyin!",
|
18 |
+
examples=[
|
19 |
+
["example1.jpg"] # Örnek görselin dosya yolu
|
20 |
+
]
|
21 |
+
)
|
22 |
+
|
23 |
+
# Uygulamayı başlat
|
24 |
+
interface.launch()
|