Spaces:
Running on Zero
Running on Zero
File size: 324 Bytes
9a12c0e | 1 2 3 4 5 6 7 | """FastAPI inference service for the PCB defect detector."""
import os
# Refuse to decode absurdly large images (decompression bombs) inside OpenCV itself.
# Must be set before cv2 is imported anywhere in the process.
os.environ.setdefault("OPENCV_IO_MAX_IMAGE_PIXELS", os.environ.get("MAX_IMAGE_PIXELS", str(40_000_000)))
|