|
import gradio as gr |
|
from transformers import pipeline |
|
from PIL import Image |
|
|
|
|
|
model_name = "kedimestan/mobilevit-x-small" |
|
classifier = pipeline("image-classification", model=model_name) |
|
|
|
|
|
def predict(image: Image.Image): |
|
|
|
image = image.resize((250, 250)) |
|
result = classifier(image) |
|
return result[0]["label"] |
|
|
|
|
|
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) |