Devashishraghav's picture
Upload processor/pipeline.py with huggingface_hub
5f25ffa verified
Raw
History Blame
647 Bytes
from .bg_removal import remove_background_and_crop
from .upscale import upscale_image
from .redaction import redact_names
def run_card_pipeline(image_bytes: bytes):
"""
Executes the full image processing pipeline.
1. Background Removal & Tight Crop
2. AI Upscaling
3. OCR Redaction
Returns the final processed OpenCV BGR image.
"""
# 1. Background removal and tight crop
img = remove_background_and_crop(image_bytes)
# 2. Upscale image
img = upscale_image(img)
# 3. Redact Names (Disabled for now per user feedback)
# img = redact_names(img)
return img