# Python 图像背景移除库依赖 # FastAPI 服务器依赖 fastapi>=0.104.0 uvicorn[standard]>=0.24.0 requests>=2.31.0 websockets>=12.0 aiohttp>=3.9.0 # 方案1: rembg (最简单,推荐,CPU友好) rembg>=2.0.0 Pillow>=9.0.0 # 方案2: BiRefNet (效果最好,需要GPU) # 注意: BiRefNet 的完整依赖在 BiRefNet/requirements.txt 中 # 如果需要使用 BiRefNet,请运行: pip install -r BiRefNet/requirements.txt # 主要依赖包括: # - torch>=2.5.0 # - torchvision # - numpy<2 # - opencv-python # - timm # - scipy # - scikit-image # - kornia # - einops # - transformers (用于从 HuggingFace 加载模型) # - huggingface-hub>0.25 # - accelerate