File size: 737 Bytes
dcb13e2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import gradio as gr
from transformers import pipeline
model_yolu = "buketyeter/blood_cell_project"
pipe = pipeline("image-classification", model=model_yolu)
def tahmin_et(resim):
sonuclar = pipe(resim)
return {sonuc['label']: sonuc['score'] for sonuc in sonuclar}
# Arayüz Tasarımı
arayuz = gr.Interface(
fn=tahmin_et,
inputs=gr.Image(type="pil"),
outputs=gr.Label(num_top_classes=3),
title="AI Blood Cell Analysis System",
description="""
This application is an automated blood cell classification system powered by a fine-tuned **SwinV2 Transformer** architecture.
Please upload a microscopic blood cell image to analyze and identify its type.
""",
theme="default"
)
arayuz.launch() |