Xenova HF Staff commited on
Commit
87fad30
·
verified ·
1 Parent(s): bfee942

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -26,7 +26,7 @@ You can then use the model for portrait matting, as follows:
26
  ```js
27
  import { pipeline } from '@huggingface/transformers';
28
 
29
- const segmenter = await pipeline('background-removal', 'Xenova/modnet', { dtype: 'fp32' });
30
  const url = 'https://images.pexels.com/photos/5965592/pexels-photo-5965592.jpeg?auto=compress&cs=tinysrgb&w=1024';
31
  const output = await segmenter(url);
32
  output[0].save('mask.png');
@@ -39,8 +39,8 @@ Or with the `AutoModel` and `AutoProcessor` APIs:
39
  import { AutoModel, AutoProcessor, RawImage } from '@huggingface/transformers';
40
 
41
  // Load model and processor
42
- const model = await AutoModel.from_pretrained('Xenova/modnet', { dtype: 'fp32' });
43
- const processor = await AutoProcessor.from_pretrained('Xenova/modnet');
44
 
45
  // Load image from URL
46
  const url = 'https://images.pexels.com/photos/5965592/pexels-photo-5965592.jpeg?auto=compress&cs=tinysrgb&w=1024';
 
26
  ```js
27
  import { pipeline } from '@huggingface/transformers';
28
 
29
+ const segmenter = await pipeline('background-removal', 'onnx-community/modnet-webnn', { dtype: 'fp32' });
30
  const url = 'https://images.pexels.com/photos/5965592/pexels-photo-5965592.jpeg?auto=compress&cs=tinysrgb&w=1024';
31
  const output = await segmenter(url);
32
  output[0].save('mask.png');
 
39
  import { AutoModel, AutoProcessor, RawImage } from '@huggingface/transformers';
40
 
41
  // Load model and processor
42
+ const model = await AutoModel.from_pretrained('onnx-community/modnet-webnn', { dtype: 'fp32' });
43
+ const processor = await AutoProcessor.from_pretrained('onnx-community/modnet-webnn');
44
 
45
  // Load image from URL
46
  const url = 'https://images.pexels.com/photos/5965592/pexels-photo-5965592.jpeg?auto=compress&cs=tinysrgb&w=1024';