Browse Source

Dependency fix (#691)

Pavel Mises 9 months ago
parent
commit
3a7ba4b9a8
2 changed files with 12 additions and 3 deletions
  1. 11 2
      README.md
  2. 1 1
      setup.py

+ 11 - 2
README.md

@@ -74,13 +74,22 @@ python: >3.7, <3.13
 
 
 ## Installation
 ## Installation
 
 
-CPU support:
+If you have `onnxruntime` already installed, just install `rembg`:
 
 
 ```bash
 ```bash
 pip install rembg # for library
 pip install rembg # for library
 pip install "rembg[cli]" # for library + cli
 pip install "rembg[cli]" # for library + cli
 ```
 ```
 
 
+Otherwise, install `rembg` with explicit CPU/GPU support.
+
+CPU support:
+
+```bash
+pip install rembg[cpu] # for library
+pip install "rembg[cpu,cli]" # for library + cli
+```
+
 GPU support:
 GPU support:
 
 
 First of all, you need to check if your system supports the `onnxruntime-gpu`.
 First of all, you need to check if your system supports the `onnxruntime-gpu`.
@@ -94,7 +103,7 @@ Go to <https://onnxruntime.ai> and check the installation matrix.
 If yes, just run:
 If yes, just run:
 
 
 ```bash
 ```bash
-pip install "rembg[GPU]" # for library
+pip install "rembg[gpu]" # for library
 pip install "rembg[gpu,cli]" # for library + cli
 pip install "rembg[gpu,cli]" # for library + cli
 ```
 ```
 
 

+ 1 - 1
setup.py

@@ -14,7 +14,6 @@ long_description = (here / "README.md").read_text(encoding="utf-8")
 install_requires = [
 install_requires = [
     "jsonschema",
     "jsonschema",
     "numpy",
     "numpy",
-    "onnxruntime",
     "opencv-python-headless",
     "opencv-python-headless",
     "pillow",
     "pillow",
     "pooch",
     "pooch",
@@ -37,6 +36,7 @@ extras_require = {
         "twine",
         "twine",
         "wheel",
         "wheel",
     ],
     ],
+    "cpu": ["onnxruntime"],
     "gpu": ["onnxruntime-gpu"],
     "gpu": ["onnxruntime-gpu"],
     "cli": [
     "cli": [
         "aiohttp",
         "aiohttp",