Noeies commited on
Commit
eb6e27c
·
verified ·
1 Parent(s): 6c85081

Create Python

Browse files
Files changed (1) hide show
  1. Python +11 -0
Python ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def classify_image(image):
4
+ outputs = model(image)
5
+ return outputs # return ถึงจะแสดงใน UI ของ Gradio
6
+
7
+ gr.Interface(fn=classify_image, inputs=gr.Image(type="pil"), outputs="text").launch()
8
+
9
+ preds = model(image) # สมมติเป็น logits
10
+ pred_label = organ_labels[preds.argmax()] # แปลงเป็นชื่ออวัยวะ
11
+ return pred_label