# ============================================================================= # Video Background Replacement - Enhanced Edition Requirements # Updated: 2025-09-11 - Fixed MatAnyone tensor compatibility issues # ============================================================================= # ============================================================================= # PyTorch ecosystem (CUDA 12.1) - PINNED VERSIONS for stability # ============================================================================= --extra-index-url https://download.pytorch.org/whl/cu121 torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 # ============================================================================= # Core scientific computing - UPDATED for PyTorch 2.4+ compatibility # ============================================================================= numpy>=1.25.0,<1.27.0 scipy==1.11.1 scikit-learn>=1.0.0 py-cpuinfo # ============================================================================= # Image and video processing - FIXED OpenCV compatibility # ============================================================================= opencv-python==4.8.1.78 Pillow==10.1.0 scikit-image==0.21.0 matplotlib==3.7.2 # ============================================================================= # Video processing and codecs # ============================================================================= moviepy==1.0.3 imageio==2.31.1 imageio-ffmpeg==0.4.9 av==10.0.0 # ============================================================================= # Core web interface - PINNED for stability # ============================================================================= gradio==4.44.1 # ============================================================================= # System monitoring and memory management # ============================================================================= psutil>=5.9.0 GitPython>=3.1.40 # ============================================================================= # Enhanced SAM2 prompting dependencies # ============================================================================= ultralytics>=8.0.0 mediapipe>=0.10.0 # ============================================================================= # SAM2 dependencies - COMPATIBLE VERSIONS # ============================================================================= onnxruntime-gpu==1.16.0 hydra-core>=1.3.2 omegaconf>=2.3.0 iopath>=0.1.10 submitit>=1.4.5 # ============================================================================= # MatAnyone dependencies - FIXED COMPATIBILITY ISSUES # ============================================================================= kornia==0.7.2 einops>=0.7.0 timm>=0.9.2 safetensors>=0.4.2 albumentations>=1.3.0 torch-geometric>=2.3.0 pytorch-lightning>=2.0.0 # ============================================================================= # Background removal # ============================================================================= rembg==2.0.50 # ============================================================================= # Utilities and progress # ============================================================================= tqdm==4.66.1 requests==2.31.0 filelock==3.12.2 # ============================================================================= # HuggingFace ecosystem - COMPATIBLE VERSIONS # ============================================================================= huggingface-hub>=0.19.3 diffusers>=0.30.0,<0.32.0 transformers>=4.44.0 accelerate>=0.33.0 xformers>=0.0.22; sys_platform != "darwin" # ============================================================================= # System monitoring and GPU utilities # ============================================================================= nvidia-ml-py3==7.352.0 pynvml>=11.5.0 gpustat>=1.1.1 # ============================================================================= # Enhanced features dependencies # ============================================================================= memory-profiler>=0.61.0 colorlog>=6.7.0 ujson>=5.8.0 base64io>=1.0.3 shortuuid>=1.0.11 randomgen>=1.23.1 alive-progress>=3.1.4 httpx>=0.25.0 aiohttp>=3.8.5 h5py>=3.9.0 hdf5storage>=0.1.19 lz4>=4.3.2 zstandard>=0.21.0 python-dotenv>=1.0.0 better-exceptions>=0.3.3 send2trash>=1.8.2 watchdog>=3.0.0 toml>=0.10.2 click>=8.1.7 rich>=13.5.2 pydantic>=2.3.0 typing-extensions>=4.7.1 more-itertools>=10.1.0 toolz>=0.12.0 regex>=2023.8.8 chardet>=5.2.0 netifaces>=0.11.0 # ============================================================================= # CRITICAL ADDITIONS for MatAnyone tensor compatibility # ============================================================================= # Image processing libraries MatAnyone expects imgaug>=0.4.0 # OpenCV full version (not headless) for complete compatibility opencv-contrib-python==4.8.1.78 # Additional tensor processing libraries tensorboard>=2.14.0 # Ensure proper CUDA tensor operations nvidia-cublas-cu12>=12.1.0 nvidia-cuda-runtime-cu12>=12.1.0 #================================= break HF SPACE ================================