瀏覽代碼

Fix t_recognizer issue. (#4387)

### What problem does this PR solve?

#4230

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.16.0
Kevin Hu 9 月之前
父節點
當前提交
2e40c2a6f6
No account linked to committer's email address
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      deepdoc/vision/t_recognizer.py

+ 3
- 3
deepdoc/vision/t_recognizer.py 查看文件

@@ -23,7 +23,7 @@ sys.path.insert(
'../../')))

from deepdoc.vision.seeit import draw_box
from deepdoc.vision import LayoutRecognizer, TableStructureRecognizer, OCR, init_in_out
from deepdoc.vision import LayoutRecognizer, TableStructureRecognizer, OCR, init_in_out, Recognizer
import argparse
import re
import numpy as np
@@ -33,12 +33,12 @@ def main(args):
images, outputs = init_in_out(args)
if args.mode.lower() == "layout":
detr = LayoutRecognizer("layout")
layouts = super(Recognizer, detr)(images, thr=float(args.threshold))
if args.mode.lower() == "tsr":
labels = TableStructureRecognizer.labels
detr = TableStructureRecognizer()
ocr = OCR()

layouts = detr(images, thr=float(args.threshold))
layouts = detr(images, thr=float(args.threshold))
for i, lyt in enumerate(layouts):
if args.mode.lower() == "tsr":
#lyt = [t for t in lyt if t["type"] == "table column"]

Loading…
取消
儲存