Giter Club home page Giter Club logo

colorization-coreml's Introduction

Colorization CoreML

This is a repository for image colorization using CoreML. The model is based on the Colorful Image Colorization paper and the original GitHub repository. The model used in this repository is named siggraph17.

res1 res2

Installation

  1. Install all requirements:
pip install -r requirements.txt
  1. Use the project ๐ŸŽ‰

Usage

To run use command below:

python run_colorization.py --data-root images

If an image is not in black and white, it will be converted to black and white before colorization. It's worth noting that the model inference will only work on MacOS due to restrictions of the coremltools framework.

Models

The first model, colorizer_core.mlmodel, expects a PIL.Image named image_small with a size of (3, 256, 256). It returns an array containing colorized_small_image, an A and B values from the LAB color space (2, 256, 256).

Afterward, you need to resize colorized_small_image to the original image size, convert this array to PIL.Image. Let's name the result ab.

The second model, colorizer_tail.mlmodel, requires the original PIL.Image, image, of any size, as well as the ab (i.e., the resized colorized_small_image from the previous model). This model returns an array containing the colorized image, colorized_image, of the original size.

Built With

  • coremltools - The NNs inference framework used
  • OpenCV - Images processing framework used
  • Pillow - Images processing framework used
  • Typer - CLI framework used

License

This project is licensed under the MIT License - see the LICENSE file for details

Authors

colorization-coreml's People

Contributors

vadbeg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.