merterbak commited on
Commit
bc6d7c7
ยท
verified ยท
1 Parent(s): 98a0392

Remove labels from text section

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -156,8 +156,8 @@ def process_image(image, mode, task, custom_prompt):
156
  if not result:
157
  return "No text", "", "", None, []
158
 
159
- cleaned = clean_output(result, False, False)
160
- markdown = clean_output(result, True, True)
161
 
162
  img_out = None
163
  crops = []
@@ -251,15 +251,15 @@ with gr.Blocks(theme=gr.themes.Soft(), title="DeepSeek-OCR") as demo:
251
 
252
  with gr.Column(scale=2):
253
  with gr.Tabs():
254
- with gr.Tab("๐Ÿ“ Text"):
255
  text_out = gr.Textbox(lines=20, show_copy_button=True, show_label=False)
256
- with gr.Tab("๐ŸŽจ Markdown"):
257
  md_out = gr.Markdown("")
258
- with gr.Tab("๐Ÿ–ผ๏ธ Boxes"):
259
  img_out = gr.Image(type="pil", height=500, show_label=False)
260
- with gr.Tab("๐Ÿ–ผ๏ธ Cropped Images"):
261
  gallery = gr.Gallery(show_label=False, columns=3, height=400)
262
- with gr.Tab("๐Ÿ” Raw"):
263
  raw_out = gr.Textbox(lines=20, show_copy_button=True, show_label=False)
264
 
265
  gr.Examples(
 
156
  if not result:
157
  return "No text", "", "", None, []
158
 
159
+ cleaned = clean_output(result, include_images=False, remove_labels=True)
160
+ markdown = clean_output(result, include_images=True, remove_labels=True)
161
 
162
  img_out = None
163
  crops = []
 
251
 
252
  with gr.Column(scale=2):
253
  with gr.Tabs():
254
+ with gr.Tab("Text"):
255
  text_out = gr.Textbox(lines=20, show_copy_button=True, show_label=False)
256
+ with gr.Tab("Markdown"):
257
  md_out = gr.Markdown("")
258
+ with gr.Tab("Boxes"):
259
  img_out = gr.Image(type="pil", height=500, show_label=False)
260
+ with gr.Tab("Cropped Images"):
261
  gallery = gr.Gallery(show_label=False, columns=3, height=400)
262
+ with gr.Tab("Raw Text"):
263
  raw_out = gr.Textbox(lines=20, show_copy_button=True, show_label=False)
264
 
265
  gr.Examples(