kedimestan's picture
Update app.py
0e8d14f verified
raw
history blame
682 Bytes
import gradio as gr
from transformers import pipeline
from PIL import Image
# Swin modelini pipeline ile yükle
model_name = "kedimestan/swin-base-patch4-window7-224"
classifier = pipeline("image-classification", model=model_name)
# Tahmin fonksiyonu
def predict(image: Image.Image):
# Görüntüyü sınıflandırma yaparak tahmin edin
result = classifier(image,padding=True)
return result[0]["label"]
# Gradio arayüzü
inputs = gr.Image(type="pil", label="Görsel Yükle")
outputs = gr.Textbox(label="Tahmin Sonucu")
gr.Interface(
fn=predict,
inputs=inputs,
outputs=outputs,
title="Retinoblastoma Tespiti",
theme="default"
).launch(debug=True)