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)