Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -488,17 +488,20 @@ class TableExtractionPipeline():
|
|
| 488 |
if __name__ == "__main__":
|
| 489 |
|
| 490 |
img_name = st.file_uploader("Upload an image with table(s)")
|
|
|
|
|
|
|
|
|
|
| 491 |
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
|
| 498 |
te = TableExtractionPipeline()
|
| 499 |
# for img in image_list:
|
| 500 |
if img_name is not None:
|
| 501 |
-
asyncio.run(te.start_process(img_name, TD_THRESHOLD=
|
| 502 |
|
| 503 |
|
| 504 |
|
|
|
|
| 488 |
if __name__ == "__main__":
|
| 489 |
|
| 490 |
img_name = st.file_uploader("Upload an image with table(s)")
|
| 491 |
+
st1, st2, st3, st4 = st.columns((1,1,1,1))
|
| 492 |
+
TD_th = st1.slider('Table detection threshold', 0, 1.0, 0.6)
|
| 493 |
+
TSR_th = st2.slider('Table structure recognition threshold', 0, 1.0, 0.8)
|
| 494 |
|
| 495 |
+
|
| 496 |
+
padd_top = st1.slider('Padding top', 0, 200, 20)
|
| 497 |
+
padd_left = st2.slider('Padding left', 0, 200, 20)
|
| 498 |
+
padd_right = st3.slider('Padding right', 0, 200, 20)
|
| 499 |
+
padd_bottom = st4.slider('Padding bottom', 0, 200, 20)
|
| 500 |
|
| 501 |
te = TableExtractionPipeline()
|
| 502 |
# for img in image_list:
|
| 503 |
if img_name is not None:
|
| 504 |
+
asyncio.run(te.start_process(img_name, TD_THRESHOLD=TD_th , TSR_THRESHOLD=TSR_th , padd_top=padd_top, padd_left=padd_left, padd_bottom=padd_bottom, padd_right=padd_right, delta_xmin=0, delta_ymin=0, delta_xmax=0, delta_ymax=0, expand_rowcol_bbox_top=0, expand_rowcol_bbox_bottom=0))
|
| 505 |
|
| 506 |
|
| 507 |
|