INNER CODE UNIT · Python

x1

gokayfem/awesome-vlm-architectures · scripts/extract_architecture_figures.py:102

            x0, x1 = page_rect.width * 0.035, page_rect.width * 0.51
        else:
            x0, x1 = page_rect.width * 0.49, page_rect.width * 0.965
    else:
        x0, x1 = page_rect.width * 0.035, page_rect.width * 0.965
    horizontal = fitz.Rect(x0, 0, x1, page_rect.height)
    previous = prose_block_before(page, caption, horizontal)
    top = previous.y1 + 5 if previous else max(page_rect.y0 + 32, caption.y0 - 390)
    if caption.y0 - top < 88:
        top = max(page_rect.y0 + 28, caption.y0 - 230)
    if caption.y0 - top > 420:
        top = caption.y0 - 420
    return fitz.Rect(x0, top, x1, max(top + 20, caption.y0 - 3))


def trim_white(image: Image.Image, padding: int = 18) -> Image.Image:
    rgb = image.convert("RGB")
    background = Image.new("RGB", rgb.size, "white")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…