Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
tags:
|
| 3 |
+
- coreml
|
| 4 |
+
- image-to-image
|
| 5 |
+
- deepmosaics
|
| 6 |
+
- computer-vision
|
| 7 |
+
- vision
|
| 8 |
+
license: mit
|
| 9 |
---
|
| 10 |
+
|
| 11 |
+
# DeepMosaics - CoreML Version
|
| 12 |
+
|
| 13 |
+
This repository contains the Apple CoreML conversions of the pre-trained models from the original [DeepMosaics](https://github.com/HypoX64/DeepMosaics) project by HypoX64.
|
| 14 |
+
|
| 15 |
+
DeepMosaics is a powerful tool for automatic video and image processing. By converting these models to **CoreML**, iOS and macOS developers can easily integrate these capabilities directly into their Apple ecosystem applications, taking full advantage of on-device hardware acceleration (Apple Neural Engine and GPU).
|
| 16 |
+
|
| 17 |
+
## 📦 Available Models
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
* `add_mosaic.mlmodel` - 用於為圖片/影片添加馬賽克
|
| 21 |
+
* `clean_mosaic_HD.mlmodel` - 用於去除馬賽克 (HD 高清版)
|
| 22 |
+
* `clean_mosaic_video.mlmodel` - 用於去除影片中的馬賽克
|
| 23 |
+
|
| 24 |
+
## 🚀 How to Use (Swift)
|
| 25 |
+
|
| 26 |
+
1. Download the desired `.mlmodel` or `.mlpackage` file from the **[Files and versions](https://huggingface.co/)** tab.
|
| 27 |
+
2. Drag and drop the file into your **Xcode** project.
|
| 28 |
+
3. Xcode will automatically generate the Swift class for the model.
|
| 29 |
+
4. Use it in your code:
|
| 30 |
+
|
| 31 |
+
```swift
|
| 32 |
+
import CoreML
|
| 33 |
+
import Vision
|
| 34 |
+
|
| 35 |
+
// 1. 初始化模型 (請替換成你的模型名稱)
|
| 36 |
+
let model = try! clean_mosaic_HD(configuration: MLModelConfiguration())
|
| 37 |
+
|
| 38 |
+
// 2. 準備輸入 (請根據你的模型實際的輸入規格修改)
|
| 39 |
+
// 例如,如果模型吃的是 CVPixelBuffer:
|
| 40 |
+
// let input = clean_mosaic_HDInput(inputImage: pixelBuffer)
|
| 41 |
+
|
| 42 |
+
// 3. 執行推論
|
| 43 |
+
// let output = try! model.prediction(input: input)
|
| 44 |
+
|
| 45 |
+
// 4. 取得結果
|
| 46 |
+
// let resultImage = output.outputImage
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
> **Note:** Please refer to Xcode's CoreML model inspector to see the exact expected input and output shapes (e.g., Image size or MultiArray dimensions).
|
| 50 |
+
|
| 51 |
+
## ⚖️ Acknowledgements & License
|
| 52 |
+
|
| 53 |
+
- Original Project: [HypoX64/DeepMosaics](https://github.com/HypoX64/DeepMosaics)
|
| 54 |
+
- All credit for the original architecture and pre-trained weights goes to the original authors.
|
| 55 |
+
- The models are provided under the same license as the original project.
|