File size: 811 Bytes
16bb15b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
import gradio as gr
from PIL import Image
from model import predict

def interface_fn(image, question):
    prediction, confidence, comment = predict(image, question)
    return f"Tahmin: {prediction} ({confidence*100:.2f}%)", comment

demo = gr.Interface(
    fn=interface_fn,
    inputs=[
        gr.Image(type="pil", label="MRI Görüntüsü Yükle"),
        gr.Textbox(label="Görselle ilgili soru", placeholder="Örnek: Bu hasta tedaviye ihtiyaç duyar mı?")
    ],
    outputs=[
        gr.Textbox(label="Tahmin Sonucu"),
        gr.Textbox(label="Tbai Yorumu")
    ],
    title="Vbai-DPA 2.3c & Tbai-DPA 1.0-BETA🧠",
    description="MRI görüntüsü ile hastalık sınıflandırması yapar ve Tbai modeli ile tıbbi yorum üretir.",
    theme="soft"
)

if __name__ == "__main__":
    demo.launch()