bowespublishing commited on
Commit
9dace56
·
verified ·
1 Parent(s): 117a24b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -10
README.md CHANGED
@@ -36,21 +36,18 @@ Both models:
36
  ## Usage with the npm package
37
 
38
  ```bash
39
- npm install @crispcut/background-removal onnxruntime-web
40
  ```
41
 
42
  ```js
43
- import { removeBackground } from '@crispcut/background-removal';
44
 
45
  // Fast mode (default) — downloads crispcut-fast.onnx from this repo
46
- const result = await removeBackground(file);
47
  img.src = result.url;
48
 
49
  // Quality mode with GPU
50
- const result = await removeBackground(file, {
51
- quality: 'quality',
52
- executionProvider: 'webgl',
53
- });
54
  ```
55
 
56
  Models are fetched automatically from this repo at runtime. No server needed — everything runs in the browser.
@@ -63,9 +60,7 @@ Models are fetched automatically from this repo at runtime. No server needed —
63
  Download the `.onnx` files from the `onnx/` folder and serve them from your own CDN:
64
 
65
  ```js
66
- removeBackground(file, {
67
- modelUrl: '/models/crispcut-fast.onnx',
68
- });
69
  ```
70
 
71
  ## Training Details
 
36
  ## Usage with the npm package
37
 
38
  ```bash
39
+ npm i @crispcut/background-removal
40
  ```
41
 
42
  ```js
43
+ import { cut } from '@crispcut/background-removal';
44
 
45
  // Fast mode (default) — downloads crispcut-fast.onnx from this repo
46
+ const result = await cut(image);
47
  img.src = result.url;
48
 
49
  // Quality mode with GPU
50
+ const result = await cut(image, { model: 'quality', gpu: true });
 
 
 
51
  ```
52
 
53
  Models are fetched automatically from this repo at runtime. No server needed — everything runs in the browser.
 
60
  Download the `.onnx` files from the `onnx/` folder and serve them from your own CDN:
61
 
62
  ```js
63
+ cut(image, { modelUrl: '/models/crispcut-fast.onnx' });
 
 
64
  ```
65
 
66
  ## Training Details