StyleCoreML conversion that enables Fast-Neural-Style-Transfer to be used on iOS and MacOS

How to use Fast-Neural-Style-Transfer on iOS

Converted Model:

Conversion Script:

Let’s make a style conversion app

Fast-Neural-Style-Transfer is a model that can convert the style of painting.
If you use it on iOS, you can create a style conversion application for images and videos.

Convert to CoreML and use on iOS and MacOS devices

Method

Clone the repository and download the pre-trained weights from the repository link.

Restore the model from pre-trained weights.

Convert.

Since the model inputs are normalized, the CoreML inputs are set to be preprocessed as well.

Create a Neural Network Builder from your model and check the output name.

To make the output of the model an RGB image, the output must also be denormalized for preprocessing.

Split tensor into color channels.
For each color channel, activate the tensor in reverse of the preprocessing and add a layer to recombine.
var_293 is the output name of the original model.

Set the output to an RGB image.

Run in Swift

🐣

I’m a freelance engineer.
Work consultation
Please feel free to contact us with a brief development description.
rockyshikoku@gmail.com

I am making an app that uses Core ML and ARKit.
We send machine learning / AR related information.

GitHub

Twitter
Medium

--

--

--

Freelance iOS developer. You can ask me for a job from any country. rockyshikoku@gmail.com https://github.com/john-rocky https://twitter.com/JackdeS11

Love podcasts or audiobooks? Learn on the go with our new app.

Stripping a Sentence Down

Be Lazy! Running a Games Team

How to manage multiple Github account

How to Write Recursion in 3 Steps

How to host a CMS-driven website for $10 a year

Connecting a Device to Oracle IoT Cloud

Python Algorithm: Pt. 12: GREEDY >:D

How Your Organization Can Implement DevSecOps

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MLBoy

MLBoy

Freelance iOS developer. You can ask me for a job from any country. rockyshikoku@gmail.com https://github.com/john-rocky https://twitter.com/JackdeS11

More from Medium

Introducing Spectre3D Fusion!

A side by side picture of the two parts of a fusion scan. On the left there is scan in process of being captured with the visual aid of lidar. On the right is the finished scan processed with photogrammetry

Augmented Reality with OpenCV

Creating an ARCore powered indoor navigation application in Unity

Unity Optimization Tools