nielsr HF staff commited on
Commit
6a04dd1
1 Parent(s): 972c6e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -20,7 +20,7 @@ model = AutoModelForObjectDetection.from_pretrained("microsoft/table-transformer
20
 
21
  # load table structure recognition model
22
  structure_processor = TableTransformerImageProcessor(max_size=1000)
23
- structure_model = AutoModelForObjectDetection.from_pretrained("microsoft/table-structure-recognition-v1.1-all")
24
 
25
  # load EasyOCR reader
26
  reader = easyocr.Reader(['en'])
@@ -247,8 +247,9 @@ def process_pdf(image):
247
  return image, df, data
248
 
249
 
250
- title = "Demo: table detection & recognition with Table Transformer"
251
- description = "Demo for table extraction with the Table Transformer (TATR)."
 
252
  examples = [['image.png', 'clip_paper.png']]
253
 
254
  app = gr.Interface(fn=process_pdf,
 
20
 
21
  # load table structure recognition model
22
  structure_processor = TableTransformerImageProcessor(max_size=1000)
23
+ structure_model = AutoModelForObjectDetection.from_pretrained("microsoft/table-transformer-structure-recognition-v1.1-all")
24
 
25
  # load EasyOCR reader
26
  reader = easyocr.Reader(['en'])
 
247
  return image, df, data
248
 
249
 
250
+ title = "Demo: table detection & recognition with Table Transformer (TATR)."
251
+ description = """Demo for table extraction with the Table Transformer. First, table detection is performed on the input image using https://huggingface.co/microsoft/table-transformer-detection,
252
+ after which the detected table is extracted and https://huggingface.co/microsoft/table-transformer-structure-recognition-v1.1-all is leveraged to recognize the individual rows, columns and cells. OCR is then performed per cell, row by row."""
253
  examples = [['image.png', 'clip_paper.png']]
254
 
255
  app = gr.Interface(fn=process_pdf,