Spaces:
Sleeping
Sleeping
Download serve/__init__.py from michaelandrew35/pcb-defect-api: direct link, hf CLI and curl.
- Browser
- Download file 324 Bytes
-
https://huggingface.co/spaces/michaelandrew35/pcb-defect-api/resolve/main/serve/__init__.py
- Command line
-
hf download hf://spaces/michaelandrew35/pcb-defect-api/serve/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/michaelandrew35/pcb-defect-api/resolve/main/serve/__init__.py
324 Bytes
| """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))) | |