Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -212,7 +212,7 @@ class TableExtractionPipeline():
|
|
212 |
text = f'{model.config.id2label[cl.item()]}: {p[cl]:0.2f}'
|
213 |
ax.text(xmin-20, ymin-50, text, fontsize=10,bbox=dict(facecolor='yellow', alpha=0.5))
|
214 |
plt.axis('off')
|
215 |
-
|
216 |
|
217 |
|
218 |
def crop_tables(self, pil_img, prob, boxes, delta_xmin, delta_ymin, delta_xmax, delta_ymax):
|
@@ -265,7 +265,7 @@ class TableExtractionPipeline():
|
|
265 |
|
266 |
|
267 |
plt.axis('on')
|
268 |
-
|
269 |
return rows, cols
|
270 |
|
271 |
def sort_table_featuresv2(self, rows:dict, cols:dict):
|
@@ -413,9 +413,9 @@ class TableExtractionPipeline():
|
|
413 |
|
414 |
df = self.clean_dataframe(df)
|
415 |
|
416 |
-
|
417 |
csv = self.convert_df(df)
|
418 |
-
|
419 |
|
420 |
return df
|
421 |
|
|
|
212 |
text = f'{model.config.id2label[cl.item()]}: {p[cl]:0.2f}'
|
213 |
ax.text(xmin-20, ymin-50, text, fontsize=10,bbox=dict(facecolor='yellow', alpha=0.5))
|
214 |
plt.axis('off')
|
215 |
+
st.pyplot()
|
216 |
|
217 |
|
218 |
def crop_tables(self, pil_img, prob, boxes, delta_xmin, delta_ymin, delta_xmax, delta_ymax):
|
|
|
265 |
|
266 |
|
267 |
plt.axis('on')
|
268 |
+
st.pyplot()
|
269 |
return rows, cols
|
270 |
|
271 |
def sort_table_featuresv2(self, rows:dict, cols:dict):
|
|
|
413 |
|
414 |
df = self.clean_dataframe(df)
|
415 |
|
416 |
+
st.dataframe(df)
|
417 |
csv = self.convert_df(df)
|
418 |
+
st.download_button("Download table", csv, "file.csv", "text/csv", key='download-csv')
|
419 |
|
420 |
return df
|
421 |
|