Git Product home page Git Product logo

pysimplegui-photo-colorizer's Introduction

pysimplegui_logo

Photo Colorization Using Deep Learning

Complete Python Application With GUI Using PySimpleGUI

Important

In order to run the demo, you will first need to download the pre-trained data from this location. At 125 MB it's too large to put into the GitHub. Place the file in the model folder.

https://www.dropbox.com/s/dx0qvhhp5hbcx7z/colorization_release_v2.caffemodel?dl=1


SNAG-0613 SNAG-0604


The Zhang Algorithm

The colorization algorithm was developed by Zhang, et al, and is detailed here:

http://richzhang.github.io/colorization/

PyImageSearch

The code implementing the algorithm is explained in a well-written tutorial by the fine folks at PyImageSearch:

https://www.pyimagesearch.com/2019/02/25/black-and-white-image-colorization-with-opencv-and-deep-learning/

Using the GUI

To use the GUI you'll need to install PySimpleGUI (http://www.PySimpleGUI.org for instructions)

One of these will install it for you.

pip install PySimpleGUI
pip3 install PySimpleGUI

Then you run the demo program using either python or python3 dependind on your system:

python PySimpleGUI_Colorizer.py
python3 PySimpleGUI_Colorizer.py

You have 2 options for choosing the image to colorize.

Folder View

If you choose a folder in the left column, then a list of files will be shown. Clicking on a file will "Preview" the image on the right side. Either copy and paste a path into the input box in the upper left corner, or use the Browse button to browse for a folder

SNAG-0627

Individual File

You can also choose an individual file using the input box in the upper right. Either paste a filename into the box or use the browse button to choose one.

Webcam

Press the Start Webcam button to see yourself colorized in realtime. It's not super fast, but it does function.

Press the Stop Webcam button to stop.

Saving The Color Image

To save your image simply press the Save File button and enter your filename.


Here is more eye-candy courtesy of Deep Learning

SNAG-0628

SNAG-0626

SNAG-0620


Webcam Multi-Window Demo

In July 2020 a new demo was added that uses the new (released to GitHub only at this point) multi-window support. This demo shows 3 video windows:

  1. Your webcam's raw video stream
  2. Grayscale version of the video
  3. Fully colorized colored of the grayscale video

Here's a screenshot to give you a rough idea of what to expect from the demo. The colors likely didn't do so well in this specific shot as there was a lot of background lighting.

SNAG-0881

You will need to use the PySimpleGUI.py file from the project's GitHub http://www.PySimpleGUI.com. Minimum version is 4.26.0.13.

pysimplegui-photo-colorizer's People

Contributors

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