VincentGOURBIN commited on
Commit
0da071b
·
verified ·
1 Parent(s): d2f14a1

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -25,9 +25,10 @@ This is a native ML Program format CoreML model converted from RMBG-2.0 (BiRefNe
25
  ### Key Features
26
 
27
  - **Native CoreML ML Program format** - Full ANE compatibility
 
28
  - **No custom layers** - Uses only native CoreML operations
29
  - **1024x1024 input resolution** - High-quality segmentation
30
- - **Fast inference** - ~3 seconds on Apple Silicon with ANE
31
 
32
  ## Usage
33
 
@@ -78,6 +79,8 @@ let mask = output.featureValue(for: "output_3")?.multiArrayValue
78
  | Normalization | ImageNet (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) |
79
  | Output | 4 scales (output_0 to output_3), use output_3 for full resolution |
80
  | Format | ML Program (.mlpackage) |
 
 
81
  | Minimum OS | macOS 13+ / iOS 16+ |
82
  | Compute Units | All (CPU, GPU, ANE) |
83
 
@@ -85,14 +88,23 @@ let mask = output.featureValue(for: "output_3")?.multiArrayValue
85
 
86
  Tested on Apple Silicon:
87
 
88
- | Device | Inference Time |
89
- |--------|---------------|
90
- | M1 Pro (ANE) | ~3s |
91
- | M1 Pro (GPU) | ~5s |
 
 
92
 
93
  ## Files
94
 
95
- - `RMBG-2-native.mlpackage/` - CoreML ML Program model
 
 
 
 
 
 
 
96
 
97
  ## License
98
 
 
25
  ### Key Features
26
 
27
  - **Native CoreML ML Program format** - Full ANE compatibility
28
+ - **INT8 weight quantization** - Reduced model size (233MB vs 461MB)
29
  - **No custom layers** - Uses only native CoreML operations
30
  - **1024x1024 input resolution** - High-quality segmentation
31
+ - **Fast inference** - ~3-5 seconds on Apple Silicon
32
 
33
  ## Usage
34
 
 
79
  | Normalization | ImageNet (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) |
80
  | Output | 4 scales (output_0 to output_3), use output_3 for full resolution |
81
  | Format | ML Program (.mlpackage) |
82
+ | Weight Quantization | INT8 (symmetric linear) |
83
+ | Model Size | ~233 MB |
84
  | Minimum OS | macOS 13+ / iOS 16+ |
85
  | Compute Units | All (CPU, GPU, ANE) |
86
 
 
88
 
89
  Tested on Apple Silicon:
90
 
91
+ | Device | Compute Units | Inference Time |
92
+ |--------|--------------|---------------|
93
+ | M1 Pro | .all (ANE) | ~5s |
94
+ | M1 Pro | .cpuAndGPU | ~3s |
95
+
96
+ > Note: ANE performance varies by device. The INT8 quantization improves memory efficiency and model size while maintaining quality.
97
 
98
  ## Files
99
 
100
+ Two model versions are available:
101
+
102
+ | File | Size | Description |
103
+ |------|------|-------------|
104
+ | `RMBG-2-native.mlpackage/` | 461 MB | Original FP32 model |
105
+ | `RMBG-2-native-int8.mlpackage/` | 233 MB | INT8 quantized model (recommended) |
106
+
107
+ **Recommended:** Use the INT8 version for better memory efficiency and smaller download size with equivalent quality.
108
 
109
  ## License
110
 
RMBG-2-native-int8.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef6031ea7ef7c8ae91217a74606208db7c82ec5adca112c5224db9ebe021947c
3
+ size 3252446
RMBG-2-native-int8.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d85cd30f732009782edd92614b1f0a740a82af5ca42191fde802dff466925467
3
+ size 241333920
RMBG-2-native-int8.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "1FA3F375-5BE6-43BE-BFEB-6B8490589024": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "F71FD107-4CF6-4D1F-922B-CCA5072E55E6": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "1FA3F375-5BE6-43BE-BFEB-6B8490589024"
18
+ }
config.json CHANGED
@@ -11,6 +11,8 @@
11
  "outputs": ["output_0", "output_1", "output_2", "output_3"],
12
  "primary_output": "output_3",
13
  "format": "mlpackage",
 
 
14
  "compute_units": "all",
15
  "minimum_deployment_target": {
16
  "macOS": "13.0",
@@ -18,5 +20,5 @@
18
  },
19
  "original_model": "briaai/RMBG-2.0",
20
  "license": "CC-BY-NC-4.0",
21
- "version": "1.0.0"
22
  }
 
11
  "outputs": ["output_0", "output_1", "output_2", "output_3"],
12
  "primary_output": "output_3",
13
  "format": "mlpackage",
14
+ "weight_quantization": "int8_symmetric_linear",
15
+ "model_size_mb": 233,
16
  "compute_units": "all",
17
  "minimum_deployment_target": {
18
  "macOS": "13.0",
 
20
  },
21
  "original_model": "briaai/RMBG-2.0",
22
  "license": "CC-BY-NC-4.0",
23
+ "version": "1.1.0"
24
  }