Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table transformer crop issue #403

Open
tzktz opened this issue Mar 29, 2024 · 0 comments
Open

Table transformer crop issue #403

tzktz opened this issue Mar 29, 2024 · 0 comments

Comments

@tzktz
Copy link

tzktz commented Mar 29, 2024

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...
download

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant