Open sasachen opened 1 month ago
I have same issues. Don't know how to fix it.
I have same issues. Don't know how to fix it.
me too.
from rembg import remove
import cv2
import onnxruntime as ort
print(ort.get_available_providers())
exit()
python 3.12 pip install onnxruntime-gpu pip install "rembg[gpu,cli]" # for library + cli pip install opencv-python
GPU is not avaliable.However,cuda is ok.
PS > python use_rembg.py
['AzureExecutionProvider', 'CPUExecutionProvider']
PS> nvidia-smi
Sat Nov 9 22:02:30 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.94 Driver Version: 560.94 CUDA Version: 12.6 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name Driver-Model | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 3060 ... WDDM | 00000000:01:00.0 Off | N/A |
| N/A 56C P8 10W / 115W | 226MiB / 6144MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 5540 C+G D:\Program Files\Tencent\QQNT\QQ.exe N/A |
| 0 N/A N/A 16676 C+G D:\Program Files\Tencent\QQNT\QQ.exe N/A |
+-----------------------------------------------------------------------------------------+
PS D:\Proj\sqc\数字人\绿幕背景换图> nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Sep_12_02:55:00_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.77
Build cuda_12.6.r12.6/compiler.34841621_0
PS >
I have same issues. Don't know how to fix it.
me too.
try thanks https://huggingface.co/briaai/RMBG-1.4 https://huggingface.co/briaai/RMBG-2.0
wen running u2netp GPU not used,CPU running full
import torch from PIL import Image
from config.conf import PROJECT_ROOT from server.rembg.rembg import new_session, remove
rembg_module = Rembg().load_image_net()
image = url_to_PIL_array(image_url)
new_img = rembg_module.process(image)
class Rembg: model = { "U2NET": "u2net", "U2NETP": "u2netp", "U2NET_HUMAN_SEG": "u2net_human_seg", "U2NET_CLOTH_SEG": "u2net_cloth_seg", "SILUETA": "silueta", "ISNET-GENERAL-USE": "isnet-general-use", "ISNET-ANIME": "isnet-anime", "SAM": "sam", }
GPU