File size: 1,852 Bytes
12f21b9 3e77535 8cefb98 12f21b9 3e77535 12f21b9 3e77535 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
---
library_name: transformers
pipeline_tag: image-segmentation
tags:
- isnet
- dis
- image-segmentation
- mask-generation
- transformers.js
- vision
- background-removal
- portrait-matting
license: apache-2.0
language:
- en
---
# IS-Net
## Model Description
IS-Net is a deep learning model designed to provide interactive image segmentation capabilities. The model allows users to refine segmentation masks through user interactions, making it highly effective for tasks that require precise and detailed segmentation results.
## Usage
Perform mask generation with `BritishWerewolf/IS-Net`.
### Example
```javascript
import { AutoModel, AutoProcessor, RawImage } from '@huggingface/transformers';
const img_url = 'https://huggingface.co/ybelkada/segment-anything/resolve/main/assets/car.png';
const image = await RawImage.read(img_url);
const processor = await AutoProcessor.from_pretrained('BritishWerewolf/IS-Net');
const processed = await processor(image);
const model = await AutoModel.from_pretrained('BritishWerewolf/IS-Net', {
dtype: 'fp32',
});
const output = await model({ input: processed.pixel_values });
// {
// mask: Tensor {
// dims: [ 1, 1024, 1024 ],
// type: 'uint8',
// data: Uint8Array(1048576) [ ... ],
// size: 1048576
// }
// }
```
### Inference
To use the model for inference, you can follow the example provided above. The `AutoProcessor` and `AutoModel` classes from the `transformers` library make it easy to load the model and processor.
## Credits
* [`rembg`](https://github.com/danielgatis/rembg) for the ONNX model.
* The authors of the original IS-Net model can be credited at https://github.com/xuebinqin/DIS.
## Licence
This model is licensed under the Apache License 2.0 to match the original IS-Net model.
|