not-lain commited on
Commit
b3cd315
·
1 Parent(s): 7e39e4c

add example

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. app.py +18 -2
  3. assets/Programme_Officiel.png +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.png filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -122,8 +122,10 @@ with gr.Blocks() as demo:
122
  label="Parsed screen elements", placeholder="Text Output"
123
  )
124
 
125
- submit_button_component.click(
126
- fn=process,
 
 
127
  inputs=[
128
  image_input_component,
129
  box_threshold_component,
@@ -132,8 +134,22 @@ with gr.Blocks() as demo:
132
  imgsz_component,
133
  ],
134
  outputs=[image_output_component, text_output_component],
 
 
135
  )
136
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  # demo.launch(debug=False, show_error=True, share=True)
138
  # demo.launch(share=True, server_port=7861, server_name='0.0.0.0')
139
  demo.queue().launch(share=False)
 
122
  label="Parsed screen elements", placeholder="Text Output"
123
  )
124
 
125
+ gr.Examples(
126
+ examples=[
127
+ ["assets/Programme_Officiel.png", 0.05, 0.1, True, 640],
128
+ ],
129
  inputs=[
130
  image_input_component,
131
  box_threshold_component,
 
134
  imgsz_component,
135
  ],
136
  outputs=[image_output_component, text_output_component],
137
+ fn=process,
138
+ cache_examples=True,
139
  )
140
 
141
+ submit_button_component.click(
142
+ fn=process,
143
+ inputs=[
144
+ image_input_component,
145
+ box_threshold_component,
146
+ iou_threshold_component,
147
+ use_paddleocr_component,
148
+ imgsz_component,
149
+ ],
150
+ outputs=[image_output_component, text_output_component],
151
+ )
152
+
153
  # demo.launch(debug=False, show_error=True, share=True)
154
  # demo.launch(share=True, server_port=7861, server_name='0.0.0.0')
155
  demo.queue().launch(share=False)
assets/Programme_Officiel.png ADDED

Git LFS Details

  • SHA256: 997149c3ceaf60c29e49f6d319220e80a70211d386e9eebb8f1042c9d53c7f7f
  • Pointer size: 131 Bytes
  • Size of remote file: 270 kB