CoreML and Keras implementation of Super-Resolution Convolutional Neural Network (SRCNN)
Switch branches/tags
Nothing to show
Clone or download
Latest commit 251acfc Mar 4, 2018
Failed to load latest commit information.
CoreMLHelpers @ 0a4b559 add CoreMLHelpers as submodule Mar 1, 2018
SRCNN-ios add files Mar 1, 2018
model fix Mar 1, 2018
script add files Mar 1, 2018
.gitignore add files Mar 1, 2018
.gitmodules add files Mar 1, 2018
LICENSE add files Mar 1, 2018 Merge pull request #1 from sdushantha/master Mar 4, 2018


Implementation of Super Resolution (SR) with CoreML and Swift. You can use SR method in your app using SRCNNKit UIImageView extension.

For details, see the following presentaion:

Pre trained model

Sorry, this project dosen't contain *.mlmodel yet. You should train your own model and import SRCNN.mlmodel to your project.



import SRCNNKit

let imageView: UIImageView = ...
let image: UIImage = ...



  • Copy sources to your project.
  • CocoaPods and Carthage will be supported soon.


  • iOS11
  • Xcode9.x

Run sample project

  • Copy your SRCNN.mlmodel to model directory
  • Run following command:
git submodule init
git submodule update
  • Open SRCNN-ios/SRCNN-ios.xcodeproj and Run

Train Your own model


  • Python 3.0+
  • see script/packages.txt

Convert Training Data

cd script
python3 <original train image dir> <train data dir>
python3 <original validation image dir> <validation data dir>


python3 <tf log dir> <model output dir> <train data dir> <validation data dir>

Plot Model Image

python <.h5 model path> <output dir>

Convert Keras to CoreML Model

python3 <h5 mode path> <output dir>

Validate CoreML Model

python3 <mlmodel path> <input patch image path> <output patch image path>



SRCNNKit is released under the MIT license. See LICENSE for details.

Copyright © 2018 DeNA Co., Ltd. All rights reserved.