• Stars
    star
    157
  • Rank 230,699 (Top 5 %)
  • Language
    Python
  • Created over 4 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Transform black and white images (or your webcam) into beautifully colored images using Deep Learning. Uses OpenCV and Numpy to Colorize your photo or webcam video. GUI provided by PySimpleGUI.

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.

More Repositories

1

PySimpleGUI

Python GUIs for Humans! PySimpleGUI is the top-rated Python application development environment. Launched in 2018 and actively developed, maintained, and supported in 2024. Transforms tkinter, Qt, WxPython, and Remi into a simple, intuitive, and fun experience for both hobbyists and expert users.
Python
13,080
star
2

PySimpleGUI-YOLO

A YOLO Artificial Intelligence algorithm demonstration using PySimpleGUI
Python
114
star
3

PySimpleGUI-Widgets

Rainmeter-like Widgets for your desktop using the easy to use PySimpleGUI package
Python
73
star
4

PySimpleGUI-COVID19

A collection of PySimpleGUI based tools to help analyze the spread of the COVID-19 virus
Python
71
star
5

PySimpleGUI-Base64-Encoder

Convert your JPG, PNG, GIF and ICO files into Base64 strings for inclusion in your source code. Add icons, game graphics, etc, to your Python source code.
Python
33
star
6

ptoaster

Display a toaster-style window on your screen that fades in / fades out. Built-in or custom icons. Uses PySimpleGUI as the GUI SDK.
Python
24
star
7

PySimpleGUI-Reddit-Searcher

Uses the PRAW Reddit APIs to search popuplar Python released subreddits for strings of your choice. Search posts and/or comments. Launch a browser to the individual posts by title.
Python
22
star
8

PySimpleHotkey

A hotkey manager that runs in the system tray. Uses PySimpleGUI for the GUI and the system tray.
Python
22
star
9

PySimpleGUI-Rainmeter-CPU-Cores

Displays a rainmeter style desktop widget that displays the CPU utilization as a grid of scrolling graphs, each being an area graph of CPU usage per core. Uses PySimpleGUI and psutil.
Python
18
star
10

LiveREPL

Use a REPL while your program executes. Watch what's happening, change variables, execute code
Python
15
star
11

ScreenShots

A dump of screenshots found on GitHub of projects related to PySimpleGUI. They have not yet been sorted / organized
Python
13
star
12

SpringerFreeBooks_GUI

GUI to download the free books released by Springer during the COVID19 quarantine
Python
8
star
13

psgfiglet_old

A GUI Based Figlet Maker
Python
8
star
14

psgdemos

The PySimpleGUI Demo Programs (also in main PySimpleGUI repo) To get: python -m pip install psgdemos
Python
7
star
15

psgshortcut

psgshortcut- a PySimpleGUI application that will create shortcuts on Windows to your Python, EXE, Batch files... or any other file using a GUI made with PySimpleGUI.
Python
5
star
16

psggadgets

Desktop Gadgets using PySimpleGUI
Python
5
star
17

DocsCleanup

4
star
18

psgcompiler

A simple, easy to use tool that is a front-end to PyInstaller created with PySimpleGUI to convert your Python programs to executables.
Python
4
star
19

psgfiglet

Create Figlets easily using this application created using PySimpleGUI.
Python
3
star
20

psghotkey

A Hotkey Manager using PySimpleGUI and psgtray
Python
2
star
21

psgyolo

Using PySimpleGUI with OpenCV to perform object detection using YOLO AI algorithm
Python
2
star
22

psgtray

A System Tray Icon that works with the PySimpleGUI tkinter port. Uses pystray to supply the system tray. Works well under Windows.
Python
1
star
23

psgreddit

A GUI app made with PySimpleGUI used to search through Reddit and Subreddits using praw module
Python
1
star