dangtiendatdat commited on
Commit
73559a6
·
verified ·
1 Parent(s): 1069518

Update MeAI_Maincode/Polyb.py

Browse files
Files changed (1) hide show
  1. MeAI_Maincode/Polyb.py +8 -9
MeAI_Maincode/Polyb.py CHANGED
@@ -91,12 +91,11 @@ def main(image):
91
  return highlighted_image # Return the highlighted image
92
 
93
  def create_polyb():
94
- demo = gr.Interface(
95
- fn=main,
96
- inputs=gr.Image(label = "Xin Nhập Ảnh Vào", type = 'pil', height=512, width=512,
97
- value="/anh/braintt.jpg",interactive=True),
98
- outputs=gr.Image(label = "Kết Quả", type = 'pil', height=512, width=512),
99
- title="Highlight Polyps",
100
- description="Tải lên một hình ảnh và phát hiện polyp với LangSAM."
101
- )
102
- return demo
 
91
  return highlighted_image # Return the highlighted image
92
 
93
  def create_polyb():
94
+ with gr.Blocks() as demo:
95
+ gr.Markdown("Hãy tải ảnh lên và nhấn **Xử Lý** để khoanh vùng Polyp.")
96
+ with gr.Row():
97
+ inp = gr.Image(label= "Nhập Ảnh",type="pil",height=512, width=512,value="../anh/viemphoi.jpeg"),interactive=True)
98
+ out = gr.Label(label="Kết Quả Dự Đoán", type = 'pil', height=512, width=512)
99
+ btn = gr.Button("Xử ")
100
+ btn.click(fn=main, inputs=inp, outputs=out)
101
+ return demo