mlboydaisuke commited on
Commit
19b0048
·
verified ·
1 Parent(s): 6f17816

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +13 -5
README.md CHANGED
@@ -7,7 +7,7 @@ tags:
7
  - on-device
8
  - image-segmentation
9
  ---
10
- # u2net — ExecuTorch XNNPACK
11
 
12
  - **Source**: xuebinqin/U-2-Net + Carve/u2net-universal weights
13
  - **License**: Apache-2.0
@@ -18,17 +18,25 @@ tags:
18
 
19
  All variants take and return fp32 tensors — swap the `.pte` file, keep your app code.
20
 
21
- | precision | file | size (MB) | parity vs fp32 eager (worst corr) | Mac median (ms)* |
22
  |-----------|------|-----------|------------------------------------|------------------|
23
  | fp32 | `u2net_xnnpack_fp32.pte` | 176.0 | 1.000000 | 56.5 |
 
 
 
 
 
 
 
 
24
 
25
  \*Mac arm64, single process, median of 10 — a reference point for relative cost
26
  only, not a device number (torch eager fp32 on the same machine: 138.5 ms).
27
 
28
- ### Precisions that did not earn a slot
29
 
30
  - **fp16 is not shipped**: it comes out at 100% of the fp32 file (176.0 MB vs 176.0 MB), so it buys nothing. XNNPACK serializes convolution weights as fp32 no matter what dtype the graph carries, so on a conv-heavy model fp16 saves no disk and only adds cast operations. Reach for int8 here, not fp16.
31
- - **int8 is not shipped**: mask IoU 0.814 median and 0.212 at worst against fp32. The int8 build systematically shrinks weak saliency: on a photo where fp32 marks 2.2% of pixels foreground it marks 0.5%. On images with an unambiguous subject it agrees closely (0.99), but that is not a promise this model can make.
32
 
33
  ## Verification (executorch 1.4.0, torch 2.13.0)
34
 
@@ -43,5 +51,5 @@ XNNPACK delegate coverage (fp32): 100.0% (477/477 ops)
43
 
44
  ## Conversion
45
 
46
- torch.export -> to_edge_transform_and_lower(XnnpackPartitioner) -> .pte
47
  (conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models))
 
7
  - on-device
8
  - image-segmentation
9
  ---
10
+ # u2net — ExecuTorch
11
 
12
  - **Source**: xuebinqin/U-2-Net + Carve/u2net-universal weights
13
  - **License**: Apache-2.0
 
18
 
19
  All variants take and return fp32 tensors — swap the `.pte` file, keep your app code.
20
 
21
+ | build | file | size (MB) | parity vs fp32 eager (worst corr) | Mac median (ms)* |
22
  |-----------|------|-----------|------------------------------------|------------------|
23
  | fp32 | `u2net_xnnpack_fp32.pte` | 176.0 | 1.000000 | 56.5 |
24
+ | Core ML (fp16, iOS) | `u2net_coreml_all.pte` | 89.0 | 0.999994 | 12.7 |
25
+
26
+
27
+ The Core ML build is the same graph lowered to Apple's Neural Engine instead of
28
+ XNNPACK, which is CPU-only. On an iPhone 17 Pro, Depth-Anything-V2-Small runs
29
+ 500.8 ms through XNNPACK and 42.7 ms through Core ML, at half the file size. It
30
+ computes in fp16 and is iOS-only; the XNNPACK files stay the portable option and
31
+ are what runs on Android.
32
 
33
  \*Mac arm64, single process, median of 10 — a reference point for relative cost
34
  only, not a device number (torch eager fp32 on the same machine: 138.5 ms).
35
 
36
+ ### Builds that did not earn a slot
37
 
38
  - **fp16 is not shipped**: it comes out at 100% of the fp32 file (176.0 MB vs 176.0 MB), so it buys nothing. XNNPACK serializes convolution weights as fp32 no matter what dtype the graph carries, so on a conv-heavy model fp16 saves no disk and only adds cast operations. Reach for int8 here, not fp16.
39
+ - **int8 is not shipped**: measured in the units that matter for this model mask IoU at 0.5: median 0.9888 over 10 real images, worst 0.2124.
40
 
41
  ## Verification (executorch 1.4.0, torch 2.13.0)
42
 
 
51
 
52
  ## Conversion
53
 
54
+ torch.export -> to_edge_transform_and_lower(partitioner) -> .pte
55
  (conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models))