supermy commited on
Commit
fbddea5
1 Parent(s): 6d415e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -19
app.py CHANGED
@@ -88,22 +88,9 @@ def set_example_url(example: list) -> dict:
88
 
89
  title = """<h1 id="title">目标检测</h1>"""
90
 
91
- description = """
92
- Links to HuggingFace Models:
93
-
94
- - [facebook/detr-resnet-50](https://huggingface.co/facebook/detr-resnet-50)
95
- - [facebook/detr-resnet-101](https://huggingface.co/facebook/detr-resnet-101)
96
- - [hustvl/yolos-small](https://huggingface.co/hustvl/yolos-small)
97
- - [hustvl/yolos-tiny](https://huggingface.co/hustvl/yolos-tiny)
98
-
99
- """
100
-
101
  models = ["facebook/detr-resnet-50","facebook/detr-resnet-101",'hustvl/yolos-small','hustvl/yolos-tiny']
102
  urls = ["https://c8.alamy.com/comp/J2AB4K/the-new-york-stock-exchange-on-the-wall-street-in-new-york-J2AB4K.jpg"]
103
 
104
- twitter_link = """
105
- [![](https://img.shields.io/twitter/follow/nickmuchi?label=@nickmuchi&style=social)](https://twitter.com/nickmuchi)
106
- """
107
 
108
  css = '''
109
  h1#title {
@@ -116,21 +103,21 @@ with demo:
116
  gr.Markdown(title)
117
  gr.Markdown(description)
118
  gr.Markdown(twitter_link)
119
- options = gr.Dropdown(choices=models,label='Select Object Detection Model',show_label=True)
120
  slider_input = gr.Slider(minimum=0.2,maximum=1,value=0.7,label='Prediction Threshold')
121
 
122
  with gr.Tabs():
123
- with gr.TabItem('Image URL'):
124
  with gr.Row():
125
- url_input = gr.Textbox(lines=2,label='Enter valid image URL here..')
126
  img_output_from_url = gr.Image(shape=(650,650))
127
 
128
  with gr.Row():
129
  example_url = gr.Dataset(components=[url_input],samples=[[str(url)] for url in urls])
130
 
131
- url_but = gr.Button('Detect')
132
 
133
- with gr.TabItem('Image Upload'):
134
  with gr.Row():
135
  img_input = gr.Image(type='pil')
136
  img_output_from_upload= gr.Image(shape=(650,650))
@@ -149,7 +136,7 @@ with demo:
149
  example_url.click(fn=set_example_url,inputs=[example_url],outputs=[url_input])
150
 
151
 
152
- gr.Markdown("![visitor badge](https://visitor-badge.glitch.me/badge?page_id=nickmuchi-object-detection-with-detr-and-yolos)")
153
 
154
 
155
  demo.launch(enable_queue=True)
 
88
 
89
  title = """<h1 id="title">目标检测</h1>"""
90
 
 
 
 
 
 
 
 
 
 
 
91
  models = ["facebook/detr-resnet-50","facebook/detr-resnet-101",'hustvl/yolos-small','hustvl/yolos-tiny']
92
  urls = ["https://c8.alamy.com/comp/J2AB4K/the-new-york-stock-exchange-on-the-wall-street-in-new-york-J2AB4K.jpg"]
93
 
 
 
 
94
 
95
  css = '''
96
  h1#title {
 
103
  gr.Markdown(title)
104
  gr.Markdown(description)
105
  gr.Markdown(twitter_link)
106
+ options = gr.Dropdown(choices=models,label='选择目标检测模型',show_label=True)
107
  slider_input = gr.Slider(minimum=0.2,maximum=1,value=0.7,label='Prediction Threshold')
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')
123
  img_output_from_upload= gr.Image(shape=(650,650))
 
136
  example_url.click(fn=set_example_url,inputs=[example_url],outputs=[url_input])
137
 
138
 
139
+ gr.Markdown("![visitor badge](https://visitor-badge.glitch.me/badge?page_id=supermy/Object-Detection/)")
140
 
141
 
142
  demo.launch(enable_queue=True)