Transformers-Tutorials
Transformers-Tutorials copied to clipboard
Table transformer crop issue
below table detection exactly crops the table.. but i need some gap in right and left side... because when we pass the table crop image to ocr edges values were mismatch...
How to adjust resize value.. i have set max resize into 800
class MaxResize(object):
def __init__(self, max_size=800):
self.max_size = max_size
def __call__(self, image):
width, height = image.size
current_max_size = max(width, height)
scale = self.max_size / current_max_size
resized_image = image.resize((int(round(scale*width)), int(round(scale*height))))
return resized_image
detection_transform = transforms.Compose([
MaxResize(800),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
])
@NielsRogge @grahamannett @FrancescoSaverioZuppichini