Coder Social home page Coder Social logo

zumbov2 / colorizer Goto Github PK

View Code? Open in Web Editor NEW
20.0 3.0 0.0 18.79 MB

An R wrapper for the DeOldify image colorization API on DeepAI.

Home Page: https://deepai.org/machine-learning-model/colorizer

License: Other

R 100.00%
deoldify image colorization rstats-package

colorizer's Introduction

CRAN_Status_Badge Lifecycle Build Status cranlogs

colorizer

This R package is an interface to the awesome DeOldify image colorization API on DeepAI, providing the possibility to colorize and restore old images. More about the NoGAN learning method used to train DeOldify can be found here.

The default api-key can be used to make a few requests. After registration on DeepAI, around 5000 requests are currently (Oct 2020) possible within the free service.

Installation

Version 0.1.0 is on CRAN and can be installed as follows:

install.packages("colorizer")

Install from GitHub for a regularly updated version (latest: 0.1.0):

install.packages("devtools")
devtools::install_github("zumbov2/colorizer")

Functions

The package provides three functions/verbs: colorize() to perform API requests, juxtapose() to create different comparisons of original and colorized images, and clsave() to save colorized images and comparisons.

Examples

Breadfruit, approx. 1870

# API call
colorizer::colorize(
  img = "https://upload.wikimedia.org/wikipedia/commons/9/9e/Breadfruit.jpg", 
  key = my_key
  ) %>%
  
  # Saving colorized image
  colorizer::clsave(destfile = "colorized.png") %>% 
  
  # Comparing colorized image to original
  colorizer::juxtapose(type = "side-by-side") %>% 
  
  # Saving comparsion
  colorizer::clsave(destfile = "comparison.png") 

Children, 1920s

colorizer::colorize(
  img = "https://cdn.pixabay.com/photo/2013/02/13/22/38/children-81487_1280.jpg", 
  key = my_key,
  ) %>% 
  juxtapose("side-by-side") %>% 
  clsave("children1920.jpg")

My Grandpa, 1936

colorizer::colorize(
  img = "diskus1936.jpg", 
  key = my_key
  ) %>%
  colorizer::juxtapose("side-by-side") %>% 
  colorizer::clsave("HansZumbach.jpg") 

John Wayne and Gail Russell, 1940s

colorizer::colorize(
  img = "https://cdn.pixabay.com/photo/2014/07/16/03/49/john-wayne-394468_1280.jpg", 
  key = my_key
  ) %>%
  colorizer::juxtapose("side-by-side") %>% 
  colorizer::clsave("Wayne-Russel.jpg") 

Types of juxtaposition

The comparisons are made using the magick package โ€“ for platform-specific dependencies please see the section Installation. The following juxtaposition types are currently available:

type = "side-by-side"

type = "stacked"

type = "c-focus"

type = "h-focus"

type = "v-focus"

type = "h-split"

type = "v-split"

type = "d-split"

type = "u-animate"

type = "s-animate"

colorizer's People

Contributors

zumbov2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.