Instructions to use Craftimon/birefnet-lite-512-webgpu with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Craftimon/birefnet-lite-512-webgpu with Transformers.js:
// ⚠️ Unknown pipeline tag
Upload 4 files
Browse files- ORIGINAL-README.md +13 -0
- README.md +6 -0
- config.json +6 -0
- preprocessor_config.json +23 -0
ORIGINAL-README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: transformers.js
|
| 4 |
+
pipeline_tag: image-segmentation
|
| 5 |
+
base_model: ZhengPeng7/BiRefNet_lite
|
| 6 |
+
---
|
| 7 |
+
|
| 8 |
+
# BiRefNet_lite 512 (WebGPU)
|
| 9 |
+
|
| 10 |
+
BiRefNet_lite (MIT, by ZhengPeng7) at 512x512, fp16 ONNX, from `studioludens/birefnet-lite-512`.
|
| 11 |
+
The graph is rewritten so it runs fully on WebGPU within phone GPU limits: deformable-conv
|
| 12 |
+
`GatherND` nodes and wide `Split` nodes are replaced with equivalent ops using the MIT patch
|
| 13 |
+
scripts from `jiabins0303/birefnet-lite-1024-webgpu`. Output is bit-identical to the original.
|
README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
library_name: transformers.js
|
| 4 |
---
|
| 5 |
+
# birefnet-lite-512-webgpu
|
| 6 |
+
|
| 7 |
+
A pinned copy of [Wattsey/birefnet-lite-512-webgpu](https://huggingface.co/Wattsey/birefnet-lite-512-webgpu) (commit `afd4af960313c1df8113cd8afe8d6bb5bdfcb04a`), kept so that Craftimon Studio's
|
| 8 |
+
picture tools keep working if the original repository changes. **Not our work:** all credit goes to the original
|
| 9 |
+
authors (see the original repository and its README). Licence: MIT (BiRefNet by ZhengPeng7), unchanged from the original.
|
config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "swin",
|
| 3 |
+
"transformers.js_config": {
|
| 4 |
+
"dtype": "fp16"
|
| 5 |
+
}
|
| 6 |
+
}
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"do_rescale": true,
|
| 4 |
+
"do_resize": true,
|
| 5 |
+
"feature_extractor_type": "ViTFeatureExtractor",
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.485,
|
| 8 |
+
0.456,
|
| 9 |
+
0.406
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "ViTFeatureExtractor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.229,
|
| 14 |
+
0.224,
|
| 15 |
+
0.225
|
| 16 |
+
],
|
| 17 |
+
"resample": 2,
|
| 18 |
+
"rescale_factor": 0.00392156862745098,
|
| 19 |
+
"size": {
|
| 20 |
+
"height": 512,
|
| 21 |
+
"width": 512
|
| 22 |
+
}
|
| 23 |
+
}
|