我无法生成背景被删除的图像
from rembg import remove
from PIL import Image
input_path = "crop.jpeg"
output_path = 'crop1.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
我有错误:RuntimeError: D:a_work1sonnxruntimecoresessionprovider_bridge_ort。cc:1069 onnxruntime::ProviderLibrary::Get [ONNXRuntimeError]:1: FAIL: LoadLibrary错误126失败"当试图加载"C:userslibsite-packagesonnxruntimecapi onnxruntime_providers_tensort .dll">
这是一个onnxruntime包问题。只要重新安装onnxruntime就可以了。
pip uninstall rembg //uninstall rembg
pip uninstall onnxruntime //uninstall onnxruntime
pip install rembg[gpu] onnxruntime-gpu //install rembg with GPU support