mlboydaisuke commited on
Commit
c91d215
·
verified ·
1 Parent(s): 2f1e16f

Add model card

Browse files
Files changed (1) hide show
  1. README.md +84 -0
README.md ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bsd-3-clause
3
+ library_name: coreml
4
+ pipeline_tag: image-to-image
5
+ tags:
6
+ - coreml
7
+ - core-ml
8
+ - ios
9
+ - macos
10
+ - apple
11
+ - on-device
12
+ - super-resolution
13
+ - upscaling
14
+ - gan
15
+ - arxiv:2107.10833
16
+ ---
17
+
18
+ # Real-ESRGAN 4x — Core ML
19
+
20
+ *Super Resolution, 2021*
21
+
22
+ Real-world blind super-resolution. 4× upscale from any input. Handles noise, blur, and JPEG artifacts. 512×512 input → 2048×2048 output.
23
+
24
+ Core ML conversion of [xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) for on-device inference on iPhone, iPad and Mac. Converted with `coremltools`; the packages are stateless, so all sequencing and buffering lives in your Swift code.
25
+
26
+ | | |
27
+ |---|---|
28
+ | Task | image to image |
29
+ | Upstream | [xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN) |
30
+ | Packages | 1 |
31
+ | Download size | 59 MB |
32
+ | Minimum iOS | 17.0 |
33
+ | Peak RAM | ~500 MB |
34
+
35
+ ## Files
36
+
37
+ | File | Size | Compute units | SHA-256 |
38
+ |---|---:|---|---|
39
+ | `RealESRGAN_x4.mlpackage.zip` | 59 MB | `all` | `5fd9d7ea7e6187ff…` |
40
+ | **Total** | **59 MB** | | |
41
+
42
+ `compute_units` is not a suggestion -- it is the configuration the conversion was verified against. Moving a package to a different compute unit can silently change the numerics (FP16 attention overflow) or crash on the GPU.
43
+
44
+ ## Download
45
+
46
+ ```bash
47
+ hf download mlboydaisuke/coreml-zoo --include "realesrgan/*" --local-dir ./realesrgan
48
+ unzip './realesrgan/realesrgan/*.zip' -d ./realesrgan
49
+ ```
50
+
51
+ ## Use in Swift
52
+
53
+ ```swift
54
+ import CoreML
55
+
56
+ let config = MLModelConfiguration()
57
+ config.computeUnits = .all // as converted — see the table above
58
+
59
+ // Unzip the .mlpackage, drop it into your Xcode target and Xcode compiles it
60
+ // at build time:
61
+ let model = try RealESRGAN_x4(configuration: config)
62
+
63
+ // ...or compile a downloaded .mlpackage at runtime:
64
+ let compiled = try await MLModel.compileModel(at: mlpackageURL)
65
+ let model = try MLModel(contentsOf: compiled, configuration: config)
66
+ ```
67
+
68
+ ## Demo
69
+
70
+ - **Models Zoo** — this model is downloadable and runnable inside the [Models Zoo app](https://apps.apple.com/app/id6762083207) on the App Store, no build required.
71
+
72
+ ## Conversion
73
+
74
+ - Pitfalls hit during conversion (FP16 overflow, ANE buffer limits, stride handling): [`docs/coreml_conversion_notes.md`](https://github.com/john-rocky/CoreML-Models/blob/master/docs/coreml_conversion_notes.md)
75
+ - Model index: [CoreML-Models](https://github.com/john-rocky/CoreML-Models)
76
+
77
+ ## License
78
+
79
+ The conversion inherits the upstream license: **BSD-3-Clause**.
80
+
81
+ ## Credits
82
+
83
+ - Upstream authors: [xinntao/Real-ESRGAN](https://github.com/xinntao/Real-ESRGAN), 2021
84
+ - Core ML conversion: john-rocky (Daisuke Majima)