Spaces:
Paused
Paused
Create requirements.txt
Browse files- requirements.txt +74 -0
requirements.txt
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 2 |
+
# Blueprint Room Extractor β requirements.txt
|
| 3 |
+
# Target: Hugging Face Spaces (NVIDIA T4 / A10G GPU runtime)
|
| 4 |
+
#
|
| 5 |
+
# Install order matters β torch must come before torchvision/torchaudio and
|
| 6 |
+
# before segment-anything / easyocr so they all link against the same libcuda.
|
| 7 |
+
#
|
| 8 |
+
# To run locally with GPU:
|
| 9 |
+
# pip install -r requirements.txt
|
| 10 |
+
#
|
| 11 |
+
# To run locally CPU-only (fallback):
|
| 12 |
+
# pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu
|
| 13 |
+
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 14 |
+
|
| 15 |
+
# ββ Web framework βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 16 |
+
flask>=3.0.0
|
| 17 |
+
werkzeug>=3.0.0
|
| 18 |
+
|
| 19 |
+
# ββ Core numerics βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 20 |
+
numpy>=1.26.0,<3.0
|
| 21 |
+
scipy>=1.12.0
|
| 22 |
+
scikit-image>=0.22.0
|
| 23 |
+
pillow>=10.0.0
|
| 24 |
+
|
| 25 |
+
# ββ OpenCV (CUDA-enabled build via headless + contrib) ββββββββββββββββββββββββ
|
| 26 |
+
# opencv-python-headless is the standard HF Spaces variant (no GTK/Qt deps).
|
| 27 |
+
# The opencv-contrib-python-headless build ships ximgproc (thinning) and
|
| 28 |
+
# cuda* modules when the underlying system has libcuda.so.
|
| 29 |
+
# On CPU-only machines both packages fall back gracefully; cv2.cuda
|
| 30 |
+
# functions will raise RuntimeError which we catch and route to CPU.
|
| 31 |
+
opencv-contrib-python-headless>=4.9.0.80
|
| 32 |
+
|
| 33 |
+
# ββ PyTorch β CUDA 12.1 wheel (HF Spaces default CUDA version) βββββββββββββββ
|
| 34 |
+
# HF Spaces hardware: NVIDIA T4 (sm_75) or A10G (sm_86), CUDA 12.x
|
| 35 |
+
torch>=2.3.0
|
| 36 |
+
torchvision>=0.18.0
|
| 37 |
+
torchaudio>=2.3.0
|
| 38 |
+
|
| 39 |
+
# ββ CuPy β GPU NumPy (matches CUDA 12.x on HF Spaces) ββββββββββββββββββββββββ
|
| 40 |
+
# Provides cp.asarray / cp.asnumpy for zero-copy GPUβCPU transfers and
|
| 41 |
+
# replaces NumPy hotspots (chroma erase, RLE encoding, gap analysis) on GPU.
|
| 42 |
+
cupy-cuda12x>=13.0.0
|
| 43 |
+
|
| 44 |
+
# ββ Segment Anything Model (SAM) ββββββββββββββββββββββββββββββββββββββββββββββ
|
| 45 |
+
# Facebook's original SAM β predictor.predict() runs on CUDA when available.
|
| 46 |
+
# Checkpoint (vit_h ~2.4 GB) is downloaded at runtime from HF Hub.
|
| 47 |
+
git+https://github.com/facebookresearch/segment-anything.git
|
| 48 |
+
|
| 49 |
+
# ββ OCR β EasyOCR with GPU support βββββββββββββββββββββββββββββββββββββββββββ
|
| 50 |
+
# EasyOCR uses its own torch-based CRNN; when torch.cuda.is_available() it
|
| 51 |
+
# automatically moves tensors to GPU without any code change.
|
| 52 |
+
easyocr>=1.7.1
|
| 53 |
+
|
| 54 |
+
# ββ ONNXRuntime GPU (optional accelerator for EasyOCR detection backbone) βββββ
|
| 55 |
+
# EasyOCR's detection model can run via onnxruntime-gpu if present.
|
| 56 |
+
onnxruntime-gpu>=1.18.0
|
| 57 |
+
|
| 58 |
+
# ββ Hugging Face integration ββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 59 |
+
# huggingface_hub: model download (SAM checkpoint)
|
| 60 |
+
# spaces: @spaces.GPU decorator for zero-GPU billing on HF Spaces free tier
|
| 61 |
+
huggingface_hub>=0.23.0
|
| 62 |
+
spaces>=0.29.0
|
| 63 |
+
|
| 64 |
+
# ββ Enchant spell checker (room-label validation) βββββββββββββββββββββββββββββ
|
| 65 |
+
# Requires system package: apt-get install libenchant-2-dev (add to packages.txt)
|
| 66 |
+
pyenchant>=3.2.2
|
| 67 |
+
|
| 68 |
+
# ββ Miscellaneous utilities βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 69 |
+
# imageio: used by skimage internally
|
| 70 |
+
imageio>=2.34.0
|
| 71 |
+
# tqdm: progress bars inside EasyOCR / SAM
|
| 72 |
+
tqdm>=4.66.0
|
| 73 |
+
# requests: SAM checkpoint download fallback
|
| 74 |
+
requests>=2.31.0
|