sussahoo commited on
Commit
6832b12
·
1 Parent(s): 2cab901

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -30
app.py CHANGED
@@ -370,21 +370,20 @@ def create_dataframe(cells_pytess_result: list, max_cols: int, max_rows: int, cs
370
  return df
371
 
372
 
373
- def process_image(
374
- image,
375
- td_threshold,
376
- tsr_threshold,
377
- padd_top,
378
- padd_left,
379
- padd_bottom,
380
- padd_right,
381
- delta_xmin,
382
- delta_ymin,
383
- delta_xmax,
384
- delta_ymax,
385
- expand_rowcol_bbox_top,
386
- expand_rowcol_bbox_bottom,
387
- ):
388
  image = image.convert("RGB")
389
  model, probas, bboxes_scaled = table_detector(image, THRESHOLD_PROBA=td_threshold)
390
  # plot_results_detection(model, image, probas, bboxes_scaled, delta_xmin, delta_ymin, delta_xmax, delta_ymax)
@@ -436,21 +435,7 @@ examples = [["image_0.png"]]
436
 
437
  iface = gr.Interface(
438
  fn=process_image,
439
- inputs=[
440
- gr.Image(type="pil"),
441
- gr.Slider(0, 1, 0.9),
442
- gr.Slider(0, 1, 0.8),
443
- gr.Slider(0, 200, 100),
444
- gr.Slider(0, 200, 100),
445
- gr.Slider(0, 200, 100),
446
- gr.Slider(0, 200, 100),
447
- gr.Number(0),
448
- gr.Number(0),
449
- gr.Number(0),
450
- gr.Number(0),
451
- gr.Number(0),
452
- gr.Number(0),
453
- ],
454
  outputs="text",
455
  title=title,
456
  description=description,
 
370
  return df
371
 
372
 
373
+ def process_image(image):
374
+ TD_THRESHOLD = 0.9
375
+ TSR_THRESHOLD = 0.8
376
+ padd_top = 100
377
+ padd_left = 100
378
+ padd_bottom = 100
379
+ padd_right = 20
380
+ delta_xmin = 0
381
+ delta_ymin = 0
382
+ delta_xmax = 0
383
+ delta_ymax = 0
384
+ expand_rowcol_bbox_top = 0
385
+ expand_rowcol_bbox_bottom = 0
386
+
 
387
  image = image.convert("RGB")
388
  model, probas, bboxes_scaled = table_detector(image, THRESHOLD_PROBA=td_threshold)
389
  # plot_results_detection(model, image, probas, bboxes_scaled, delta_xmin, delta_ymin, delta_xmax, delta_ymax)
 
435
 
436
  iface = gr.Interface(
437
  fn=process_image,
438
+ inputs=gr.Image(type="pil"),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
439
  outputs="text",
440
  title=title,
441
  description=description,