BRIA RMBG-1.4 背景移除/抠图模型,适配 昇腾 NPU(Ascend 910 / torch-npu)。
# CLI 单图推理
python inference.py --img test_input.jpg
# FastAPI 服务
uvicorn inference:app --host 0.0.0.0 --port 8001
curl -F "file=@test_input.jpg" http://127.0.0.1:8001/predict推理输出 JSON:device=npu:0、前景图(透明背景 PNG)路径、mask 覆盖率等。
npu:0。inference.py 顶部含 NPU 初始化 try-except。rmbg_model/(BriaRMBG 为 U²-Net 风格分割网络),权重缓存于 model_weights/briaai/RMBG-1.4/(model.safetensors,不入库)。