sussahoo commited on
Commit
04cf1c5
1 Parent(s): d117383

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -291,7 +291,7 @@ def create_dataframe(cells_pytess_result:list, max_cols:int, max_rows:int,csv_pa
291
 
292
  return df
293
 
294
- def process_image(image, TD_THRESHOLD, TSR_THRESHOLD, padd_top, padd_left, padd_bottom, padd_right, delta_xmin = 0, delta_ymin = 0, delta_xmax = 0, delta_ymax = 0, expand_rowcol_bbox_top = 0, expand_rowcol_bbox_bottom = 0):
295
  image = image.convert('RGB')
296
  model, probas, bboxes_scaled = table_detector(image, THRESHOLD_PROBA=TD_THRESHOLD)
297
  # plot_results_detection(model, image, probas, bboxes_scaled, delta_xmin, delta_ymin, delta_xmax, delta_ymax)
@@ -323,10 +323,10 @@ article = "<p style='text-align: center'></p>"
323
  examples =[["image_0.png"]]
324
 
325
  iface = gr.Interface(fn=process_image,
326
- inputs=[gr.Image(type="pil"), gr.Slider(0, 1, value=0.9), gr.Slider(0, 1, value=0.8), gr.Slider(0, 200, value=100), gr.Slider(0, 200, value=100), gr.Slider(0, 200, value=100), gr.Slider(0, 200, value=100), gr.Number(0), gr.Number(0), gr.Number(0), gr.Number(0),gr.Number(0),gr.Number(0)],
327
  outputs="text",
328
  title=title,
329
  description=description,
330
  article=article,
331
  examples=examples)
332
- iface.launch(debug=True)
 
291
 
292
  return df
293
 
294
+ def process_image(image, TD_THRESHOLD, TSR_THRESHOLD, padd_top, padd_left, padd_bottom, padd_right, delta_xmin, delta_ymin, delta_xmax, delta_ymax, expand_rowcol_bbox_top, expand_rowcol_bbox_bottom):
295
  image = image.convert('RGB')
296
  model, probas, bboxes_scaled = table_detector(image, THRESHOLD_PROBA=TD_THRESHOLD)
297
  # plot_results_detection(model, image, probas, bboxes_scaled, delta_xmin, delta_ymin, delta_xmax, delta_ymax)
 
323
  examples =[["image_0.png"]]
324
 
325
  iface = gr.Interface(fn=process_image,
326
+ inputs=[gr.Image(type="pil"), gr.Slider(0, 1, value=0.9), gr.Slider(0, 1, value=0.8), gr.Slider(0, 200, value=100), gr.Slider(0, 200, value=100), gr.Slider(0, 200, value=100), gr.Slider(0, 200, value=100), gr.Number(0), gr.Number(0), gr.Number(0), gr.Number(0),gr.Number(0),gr.Number(0)],
327
  outputs="text",
328
  title=title,
329
  description=description,
330
  article=article,
331
  examples=examples)
332
+ iface.launch(debug=True)