mirror of
https://github.com/PR0M3TH3AN/unredact.git
synced 2026-10-27 08:40:29 +00:00
Add a synchronous function that runs the analysis mini-pipeline on a single known bounding box using cached OCR data. This enables spot redaction endpoints to get full analysis (font, left/right context text, pixel alignment offsets) without needing LLM detection. Co-Authored-By: Claude Opus 4.6 <[email protected]>
23 lines
571 B
Python
23 lines
571 B
Python
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
FIXTURES_DIR = Path(__file__).parent / "fixtures"
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_pdf() -> Path:
|
|
"""Path to the sample Epstein PDF for testing."""
|
|
pdf = Path("/home/alex/Documents/EFTA00554620.pdf")
|
|
if not pdf.exists():
|
|
pytest.skip("Sample PDF not available")
|
|
return pdf
|
|
|
|
|
|
@pytest.fixture
|
|
def sample_page_image(sample_pdf):
|
|
"""Rasterize the first page of the sample PDF as a PIL Image."""
|
|
from unredact.pipeline.rasterize import rasterize_pdf
|
|
pages = rasterize_pdf(sample_pdf)
|
|
return pages[0]
|