nguyenp99 commited on
Commit
c5653bd
1 Parent(s): 234c924

Update engine.py

Browse files
Files changed (1) hide show
  1. engine.py +8 -8
engine.py CHANGED
@@ -16,15 +16,15 @@ from .stamp_processing.callback import remove_potiential_table_fp, remove_box_by
16
  class Engine(f.Pipe):
17
 
18
  def __init__(self, cfg:Config=None, table_checkpoint=None, line_checkpoint=None, verbose=True):
19
- super().__init__()
20
- self.cfg = cfg or Config()
21
- self.standard_width = cfg.STANDARD_WIDTH
22
- self.preprocessor = Preprocessor(cfg.STANDARD_WIDTH, cfg.STANDARD_INTERPOLATION)
23
- self.post_processor = TableRestore()
24
- self.table_detector = self._build_table_detector(cfg, table_checkpoint)
25
- self.stamp_detector = StampDetector(model_path=cfg.STAMP_DETECTION_CHECKPOINT, device=cfg.DEVICE)
 
26
  self.stamp_detector.model.to(cfg.DEVICE)
27
-
28
  def run(self, image):
29
  # ratio = 1.0*self.standard_width/image.shape[1]
30
  # image = self.preprocessor(image)
 
16
  class Engine(f.Pipe):
17
 
18
  def __init__(self, cfg:Config=None, table_checkpoint=None, line_checkpoint=None, verbose=True):
19
+ super().__init__(
20
+ cfg = cfg or Config(),
21
+ standard_width = cfg.STANDARD_WIDTH,
22
+ preprocessor = Preprocessor(cfg.STANDARD_WIDTH, cfg.STANDARD_INTERPOLATION),
23
+ post_processor = TableRestore(),
24
+ table_detector = self._build_table_detector(cfg, table_checkpoint),
25
+ stamp_detector = StampDetector(model_path=cfg.STAMP_DETECTION_CHECKPOINT, device=cfg.DEVICE)
26
+ )
27
  self.stamp_detector.model.to(cfg.DEVICE)
 
28
  def run(self, image):
29
  # ratio = 1.0*self.standard_width/image.shape[1]
30
  # image = self.preprocessor(image)