Project06 / Python
Noeies's picture
Create Python
eb6e27c verified
raw
history blame contribute delete
422 Bytes
import gradio as gr
def classify_image(image):
outputs = model(image)
return outputs # return ถึงจะแสดงใน UI ของ Gradio
gr.Interface(fn=classify_image, inputs=gr.Image(type="pil"), outputs="text").launch()
preds = model(image) # สมมติเป็น logits
pred_label = organ_labels[preds.argmax()] # แปลงเป็นชื่ออวัยวะ
return pred_label