DeepMosaics-CoreML / README.md
MikiHuang's picture
Update README.md
0f709b8 verified
|
Raw
History Blame Contribute Delete
2.07 kB
---
tags:
- coreml
- image-to-image
- deepmosaics
- computer-vision
- vision
license: mit
---
# DeepMosaics - CoreML Version
This repository contains the Apple CoreML conversions of the pre-trained models from the original [DeepMosaics](https://github.com/HypoX64/DeepMosaics) project by HypoX64.
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).
## 📦 Available Models
* `add_mosaic.mlmodel` - 用於為圖片/影片添加馬賽克
* `clean_mosaic_HD.mlmodel` - 用於去除馬賽克 (HD 高清版)
* `clean_mosaic_video.mlmodel` - 用於去除影片中的馬賽克
## 🚀 How to Use (Swift)
1. Download the desired `.mlmodel` or `.mlpackage` file from the **[Files and versions](https://huggingface.co/)** tab.
2. Drag and drop the file into your **Xcode** project.
3. Xcode will automatically generate the Swift class for the model.
4. Use it in your code:
```swift
import CoreML
import Vision
// 1. 初始化模型 (請替換成你的模型名稱)
let model = try! clean_mosaic_HD(configuration: MLModelConfiguration())
// 2. 準備輸入 (請根據你的模型實際的輸入規格修改)
// 例如,如果模型吃的是 CVPixelBuffer:
// let input = clean_mosaic_HDInput(inputImage: pixelBuffer)
// 3. 執行推論
// let output = try! model.prediction(input: input)
// 4. 取得結果
// let resultImage = output.outputImage
```
> **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).
## ⚖️ Acknowledgements & License
- Original Project: [HypoX64/DeepMosaics](https://github.com/HypoX64/DeepMosaics)
- All credit for the original architecture and pre-trained weights goes to the original authors.
- The models are provided under the same license as the original project.