Coder Social home page Coder Social logo

satoshiiizuka / siggraph2016_colorization Goto Github PK

View Code? Open in Web Editor NEW
2.2K 112.0 302.0 1.52 MB

Code for the paper 'Let there be Color!: Joint End-to-end Learning of Global and Local Image Priors for Automatic Image Colorization with Simultaneous Classification'.

Home Page: http://hi.cs.waseda.ac.jp/~iizuka/projects/colorization/

License: Other

Lua 52.68% Shell 47.32%

siggraph2016_colorization's Introduction

Satoshi Iizuka*, Edgar Simo-Serra*, Hiroshi Ishikawa (* equal contribution)

Teaser Image

Overview

This code provides an implementation of the research paper:

  "Let there be Color!: Joint End-to-end Learning of Global and Local Image Priors for Automatic Image Colorization with Simultaneous Classification"
  Satoshi Iizuka, Edgar Simo-Serra, and Hiroshi Ishikawa
  ACM Transaction on Graphics (Proc. of SIGGRAPH 2016), 2016

We learn to automatically color grayscale images with a deep network. Our network learns both local features and global features jointly in a single framework. Our approach can then be used on images of any resolution. By incorporating global features we are able to obtain realistic colorings with our model.

See our project page for more detailed information.

License

  Copyright (C) <2016> <Satoshi Iizuka, Edgar Simo-Serra, Hiroshi Ishikawa>

  This work is licensed under the Creative Commons
  Attribution-NonCommercial-ShareAlike 4.0 International License. To view a copy
  of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or
  send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.

  Satoshi Iizuka, Waseda University
  [email protected], http://hi.cs.waseda.ac.jp/~iizuka/index_eng.html
  Edgar Simo-Serra, Waseda University
  [email protected], http://hi.cs.waseda.ac.jp/~esimo/  

Dependencies

All packages should be part of a standard Torch7 install. For information on how to install Torch7 please see the official torch documentation on the subject.

Usage

First, download the colorization model by running the download script:

./download_model.sh

Basic usage is:

th colorize.lua <input_image> [<output_image>]

For example:

th colorize.lua ansel_colorado_1941.png out.png

Best Performance

  • This model was trained on the Places dataset and thus best performance is for natural outdoor images.
  • While the model works on any size image, we trained it on 224x224 pixel images and thus it works best on small images. Note that you can process a small imageto obtain the chrominance map and then rescale it and combine it with the original grayscale image for higher quality.
  • Larger image sizes can give uneven colorings (limited by spatial support of the network).

ImageNet Model

We also provide the colorization model that was trained on ImageNet. This model can be used for comparisons with other colorization models trained on ImageNet. We recommend using the places colorization model for general purposes.

For using the ImageNet model, download the model by running:

./download_model_imagenet.sh

Usage is:

th colorize.lua <input_image> <output_image> colornet_imagenet.t7

Notes

  • This is developed on a linux machine running Ubuntu 14.04 during late 2015.
  • The provided code does not use GPU accelerated (trivial to change).
  • Please note that the model is slow on large images (over 512x512 pixels) and may run out of memory. Demo should take around 2 GiB of peak RAM memory, system with 4 GiB or more of RAM is recommended.
  • Provided model and sample code is under a non-commercial creative commons license.

Citing

If you use this code please cite:

 @Article{IizukaSIGGRAPH2016,
   author = {Satoshi Iizuka and Edgar Simo-Serra and Hiroshi Ishikawa},
   title = {{Let there be Color!: Joint End-to-end Learning of Global and Local Image Priors for Automatic Image Colorization with Simultaneous Classification}},
   journal = "ACM Transactions on Graphics (Proc. of SIGGRAPH 2016)",
   year = 2016,
   volume = 35,
   number = 4,
 }

siggraph2016_colorization's People

Contributors

artoria2e5 avatar bobbens avatar mecab avatar nagadomi avatar satoshiiizuka avatar

Stargazers

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

Watchers

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

siggraph2016_colorization's Issues

Ubuntu 12.04

  • cloned the repo, went okay
  • fail: depends on lua, resolution=apt-get went okay -- (undocumented requirement)
  • fail: depends on luarocks, resolution=apt-get went okay -- (undocumented requirement)
  • fail: luarocks install nn fails with "lnn.c:4:23: fatal error: nanomsg/nn.h: No such file or directory" (undocumented requirement)
    • fail: nanomsg install requires npm, resolution=apt-get went okay -- (undocumented requirement)
    • fail: npm install nanomsg fails with "Error: failed to fetch from registry: nanomsg" (undocumented requirement)
      • nn depends on nanomsg -- brick wall problem

So. Any suggestions for me?

My suggestion for you is that you install this package on a fresh machine and determine what (rest of) the dependencies are, then document the full installation process.

out image file blurred

I running the example command but I got this:(without error)
out
I have 8GiB RAM and Ubuntu16.04 CUDA7.5

我按照示例的指令运行后却得到了这样的结果:(没有报错)
out
我的内存容量为8GiB,系统是Ubuntu16.04,CUDA版本为7.5

./download_model.sh 404 Not Found

can't download "download_model".

error message as below.

Downloading the colorization model (663M)...
URL transformed to HTTPS due to an HSTS policy
--2022-06-13 10:30:01--  https://hi.cs.waseda.ac.jp/~iizuka/data/colornet.t7
Resolving hi.cs.waseda.ac.jp (hi.cs.waseda.ac.jp)... 133.9.68.108, 133.9.187.220
Connecting to hi.cs.waseda.ac.jp (hi.cs.waseda.ac.jp)|133.9.68.108|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://hi.cs.waseda.ac.jp/index.php/en/~iizuka/data/colornet.t7 [following]
--2022-06-13 10:30:02--  https://hi.cs.waseda.ac.jp/index.php/en/~iizuka/data/colornet.t7
Reusing existing connection to hi.cs.waseda.ac.jp:443.
HTTP request sent, awaiting response... 404 Not Found
2022-06-13 10:30:02 ERROR 404: Not Found.

Checking integrity (md5sum)...
Download finished successfully! Time to colorize!

However finished successfully, clornet.t7 is 404 Not Found.

Segmentation fault while testing

I got everything to correctly install and upon executing the command

th colorize.lua ansel_colorado_1941.png out.png

I got this as an error message

Segmentation fault (core dumped)

(I am using Ubuntu)

layers trained weights

Can you share the layers trained weights to save time and efforts of training with this large dataset ?

t7 file open fails

Colornet file sha1sum and md5sum are both correct as detailed in issue 7. File size is correct. Problem persists where the load fails early in the script before anything else really happens. Member "franverona" is also seeing this error with a later Ubuntu, hopefully will post here as well.

network source code

Excuse me!Can you share your source code about architecture of network ? Thanks very much.

about the label

thanks for the codes, i have some trouble with the label ,could you give me some example to make me know how to label the datasets, thanks!

libpng: version warning

Hi,
Can't run th colorize.lua due to this warning. Anyone an idea how to get it working with newer libpng?

libpng warning: Application built with libpng-1.5.18 but running with 1.6.26
/Users/me/torch/install/bin/luajit: /Users/me/torch/install/share/lua/5.1/image/init.lua:156: [read_png] png_create_read_struct failed
stack traceback:
    [C]: in function 'load'
    /Users/me/torch/install/share/lua/5.1/image/init.lua:156: in function 'loader'
    /Users/me/torch/install/share/lua/5.1/image/init.lua:373: in function 'load'
    colorize.lua:38: in main chunk
    [C]: in function 'dofile'
    ...me/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x0109bcad00

(OSX 10.11.6, 3.5GHz/32GB, fresh homebrew packages)

Old scanned pictures (4000x5000) 1200-6000 DPI never finish

My MacMini use Intel i5 CPU, 8 Gb RAM (+ HDD MacOS Hihg Sierra ).

Little picture is over and the result is very nice. Single mistake, the mulch there is grassy where there is only mud.

But, never ending a big picture, 60-90 minutet and not ready.

th colorize.lua - use 8GB RAM + 6-8 GB swap + 5-20 GB compact RAM Lol
I have not seen anything like this ever:)

Original sample available, Download buttoms

Sorry google translate!

Why to use Sigmoid instead of ReLu

Thank you guys for the great idea. I'm not a Torch user so I don't know how to see the graph of the model provided by you. I read the paper and still don't know what networks use Sigmoid or ReLu transfer function. Can you give me the answer? And the reasoning?

Training code ?

Any plans to share the training code ?
Or at least the detailed model definition ?

chrominance map

hello and thanks for all that.
"Note that you can process a small imageto obtain the chrominance map and then rescale it and combine it with the original grayscale image for higher quality."
how would you do that ?
thanks in advance
luc

Error after install

I ran the torch install on my OSX 10.11.4 (latest El Capitan), downloaded the colornet file, then tried running the example command:

th colorize.lua ansel_colorado_1941.png out.png
/Users/davidbackeus/torch/install/bin/luajit: .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:375: unknown object
stack traceback:
    [C]: in function 'error'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:375: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:368: in function 'readObject'
    ...s/davidbackeus/torch/install/share/lua/5.1/nn/Module.lua:158: in function 'read'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    ...s/davidbackeus/torch/install/share/lua/5.1/nn/Module.lua:158: in function 'read'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    ...
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:353: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    ...dbackeus/torch/install/share/lua/5.1/nngraph/gmodule.lua:461: in function 'read'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:351: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
    .../davidbackeus/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
    colorize.lua:23: in main chunk
    [C]: in function 'dofile'
    ...keus/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
    [C]: at 0x0106fcbcf0

Not able to install

Hi!
I'm new to neural networks programming but very interested in this subject.

I installed torch and luarocks.
Now
luarocks install nn fails with

nanomsg/nn.h: No such file or directory

For the other two I get

Error: No results matching query were found.

Do I have to install torch with Lua 5.2 and without LuaJIT?

Cheers,
Benedikt

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.