table_detection_3 / post_processes.py
nguyenp99's picture
Create post_processes.py
d3b88f5 verified
raw
history blame
381 Bytes
import cv2
import numpy as np
import plasma.functional as f
class TableRestore(f.Pipe):
def __init__(self):
super().__init__()
def run(self, tables, ratio):
new_tables = []
for table in tables:
new_table = [(coordinate / ratio) for coordinate in table]
new_tables.append(new_table)
return np.array(new_tables)