Initial upload: MODNet fp16 mirror (Xenova/modnet fa2fa54)
Browse files- README.md +26 -0
- model_fp16.onnx +3 -0
- preprocessor_config.json +23 -0
README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Xenova/modnet
|
| 4 |
+
tags:
|
| 5 |
+
- onnx
|
| 6 |
+
- image-segmentation
|
| 7 |
+
- portrait-matting
|
| 8 |
+
---
|
| 9 |
+
# modnet-onnx
|
| 10 |
+
|
| 11 |
+
Mirror of the fp16 ONNX export of MODNet (photographic portrait matting) for the Ipsilon apps (ID2Spec and Template Studio descendants). Runs natively on ONNX Runtime (Android); never in a web layer.
|
| 12 |
+
|
| 13 |
+
## Provenance
|
| 14 |
+
- Upstream: https://huggingface.co/Xenova/modnet (commit `fa2fa546052fba4c08921230a26cc69a333fca12`), file `onnx/model_fp16.onnx`, copied unchanged. Original model: https://github.com/ZHKKKe/MODNet (Apache-2.0).
|
| 15 |
+
- Licence: Apache-2.0 (upstream card `license: apache-2.0`).
|
| 16 |
+
- `model_fp16.onnx`: 12984781 bytes, SHA-256 `25f165da9bfd30830a575f1f0490f1acd995975cb349bc02f3d79332e1fe5cf6`, opset 11.
|
| 17 |
+
- `preprocessor_config.json`: copied from upstream (reference only; the app does its own pre-processing: RGB, `(x - 127.5) / 127.5`, size snapped to a multiple of 32 around 512).
|
| 18 |
+
|
| 19 |
+
## Graph I/O (read with `onnx` python, `graph.input` / `graph.output`)
|
| 20 |
+
- Inputs: `input` FLOAT ['batch_size', 3, 'height', 'width']
|
| 21 |
+
- Outputs: `output` FLOAT ['batch_size', 1, 'height', 'width']
|
| 22 |
+
|
| 23 |
+
Note: graph input and output are FLOAT (fp32) tensors; only the weights are fp16 (internal casts), so Java code creates ordinary float32 tensors. Output is the alpha matte, values in [0, 1].
|
| 24 |
+
|
| 25 |
+
## On-device check
|
| 26 |
+
The ORT CPU provider must run this graph on a device; if it does not, an fp32 variant (`onnx/model.onnx`, 25.9 MB upstream) will be added to this repo. Status: not yet verified on a device (no device available at creation time).
|
model_fp16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:25f165da9bfd30830a575f1f0490f1acd995975cb349bc02f3d79332e1fe5cf6
|
| 3 |
+
size 12984781
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"do_pad": false,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.5,
|
| 8 |
+
0.5,
|
| 9 |
+
0.5
|
| 10 |
+
],
|
| 11 |
+
"feature_extractor_type": "ImageFeatureExtractor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.5,
|
| 14 |
+
0.5,
|
| 15 |
+
0.5
|
| 16 |
+
],
|
| 17 |
+
"resample": 2,
|
| 18 |
+
"rescale_factor": 0.00392156862745098,
|
| 19 |
+
"size": {
|
| 20 |
+
"shortest_edge": 512
|
| 21 |
+
},
|
| 22 |
+
"size_divisibility": 32
|
| 23 |
+
}
|