supermy commited on
Commit
7fba82a
1 Parent(s): 6468b6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -107,16 +107,6 @@ with demo:
107
  slider_input = gr.Slider(minimum=0.2,maximum=1,value=0.7,label='检测阀值')
108
 
109
  with gr.Tabs():
110
- with gr.TabItem('图片链接URL'):
111
- with gr.Row():
112
- url_input = gr.Textbox(lines=2,label='输入一个有效地图片地址URL')
113
- img_output_from_url = gr.Image(shape=(650,650))
114
-
115
- with gr.Row():
116
- example_url = gr.Dataset(components=[url_input],samples=[[str(url)] for url in urls])
117
-
118
- url_but = gr.Button('检测')
119
-
120
  with gr.TabItem('上传图片'):
121
  with gr.Row():
122
  img_input = gr.Image(type='pil')
@@ -128,6 +118,17 @@ with demo:
128
  for path in sorted(pathlib.Path('images').rglob('*.JPG'))])
129
 
130
  img_but = gr.Button('检测')
 
 
 
 
 
 
 
 
 
 
 
131
 
132
 
133
  url_but.click(detect_objects,inputs=[options,url_input,img_input,slider_input],outputs=img_output_from_url,queue=True)
 
107
  slider_input = gr.Slider(minimum=0.2,maximum=1,value=0.7,label='检测阀值')
108
 
109
  with gr.Tabs():
 
 
 
 
 
 
 
 
 
 
110
  with gr.TabItem('上传图片'):
111
  with gr.Row():
112
  img_input = gr.Image(type='pil')
 
118
  for path in sorted(pathlib.Path('images').rglob('*.JPG'))])
119
 
120
  img_but = gr.Button('检测')
121
+
122
+ with gr.TabItem('图片链接URL'):
123
+ with gr.Row():
124
+ url_input = gr.Textbox(lines=2,label='输入一个有效地图片地址URL')
125
+ img_output_from_url = gr.Image(shape=(650,650))
126
+
127
+ with gr.Row():
128
+ example_url = gr.Dataset(components=[url_input],samples=[[str(url)] for url in urls])
129
+
130
+ url_but = gr.Button('检测')
131
+
132
 
133
 
134
  url_but.click(detect_objects,inputs=[options,url_input,img_input,slider_input],outputs=img_output_from_url,queue=True)