/b-w_colorization

CoreML conversion of automatic colourization using deep neural networks. "Colorful Image Colorization." In ECCV, 2016

Primary LanguageJupyter NotebookBSD 2-Clause "Simplified" LicenseBSD-2-Clause

B&W Colorizer using CoreML

This is a Colorizer which using a Deep-CNN and runs using CoreML

Essentially by converting richzhang's pytorch colorizer to CoreML.
One can embed this in a any iOS/macOS/visionOS app and colorize old b&w images

You can look at the converter jupyter notebook

Or download the models directly

Demo app

How it works?

  • Essentialy this is a pytorch model ECCV16Colorizer that has been converted to CoreML
  1. Convert the UIImage to a MLShapedArray<Float> [1, 3, 512, 512] shape
  2. Then convert to same to Lab color space array [1, 1, 512, 512] shape
  3. Use this array's 'L' part to predict the 'ab' part of the image's Lab color Space Image
  4. We get an MLShapedArray<Float> [1, 2, 512, 512] then using the original 'L' array we can combine and get the Lab of the predicted Image
  5. Convert back to RGB space and convert the array to UIImage.

Credits