All Projects → mauckc → colorize-video

mauckc / colorize-video

Licence: other
colorize video using publicly available neural-networks

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to colorize-video

Learnopencv
Learn OpenCV : C++ and Python Examples
Stars: ✭ 15,385 (+64004.17%)
Mutual labels:  opencv-python, opencv3
video coloriser
Pytorch Convolutional Neural Net and GAN based video coloriser that converts black and white video to colorised video.
Stars: ✭ 29 (+20.83%)
Mutual labels:  colorization
MovieBarCodeGenerator
User friendly tool to create your own movie barcodes
Stars: ✭ 57 (+137.5%)
Mutual labels:  ffmpeg
Synfonia
Cross-platform C# Audio Player made with AvaloniaUI
Stars: ✭ 153 (+537.5%)
Mutual labels:  ffmpeg
showroom
Script for archiving AKB48 Group related Showroom streams
Stars: ✭ 48 (+100%)
Mutual labels:  ffmpeg
plant-disease-classification-tf
Disease classification on different plants with using Machine Learning and Convolutional Neural Networks.
Stars: ✭ 41 (+70.83%)
Mutual labels:  opencv-python
Indian-Number-Plate-Recognition-System
Indian Number Plate Recognition System built using OpenCV
Stars: ✭ 72 (+200%)
Mutual labels:  opencv-python
Image-to-Braille
Give it an image, and it will become unicode braille
Stars: ✭ 140 (+483.33%)
Mutual labels:  greyscale
aplayer
ffplay友好版本. 对ffplay裁剪重构以适合初学者阅读、理解
Stars: ✭ 41 (+70.83%)
Mutual labels:  ffmpeg
Computer-Vision
Cool Vision projects
Stars: ✭ 51 (+112.5%)
Mutual labels:  opencv-python
easy-real-time-face-recognition-python
No description or website provided.
Stars: ✭ 30 (+25%)
Mutual labels:  opencv-python
pulverize
A multi-process rendering script for Blender VSE.
Stars: ✭ 54 (+125%)
Mutual labels:  ffmpeg
Huong-dan-cai-dat-stream-server-va-chuyen-doi-video-sang-streaming
Hướng dẫn cài đặt stream server và chuyển đổi video thường sang dạng TS Streaming
Stars: ✭ 29 (+20.83%)
Mutual labels:  ffmpeg
streamingDemo
No description or website provided.
Stars: ✭ 56 (+133.33%)
Mutual labels:  ffmpeg
keras-mobile-colorizer
U-Net Model conditioned with MobileNet features for Grayscale -> Color mapping
Stars: ✭ 26 (+8.33%)
Mutual labels:  colorization
NaraeAudioRecorder
AudioRecorder for Android powered by Kotlin
Stars: ✭ 82 (+241.67%)
Mutual labels:  ffmpeg
crusher
Develop.Test. Ship.🦖 Open source e2 low-code web testing. Blazing fast alternative to Selenium, Cypress.
Stars: ✭ 148 (+516.67%)
Mutual labels:  ffmpeg
ffmpeg-xcode
FFmpeg Xcode project
Stars: ✭ 55 (+129.17%)
Mutual labels:  ffmpeg
Music player with Emotions recognition
This program can recognize your mood by detecting your face and play song according your mood
Stars: ✭ 79 (+229.17%)
Mutual labels:  opencv-python
VideoIO.jl
Reading and writing of video files in Julia via ffmpeg
Stars: ✭ 103 (+329.17%)
Mutual labels:  ffmpeg

colorize-video

colorize video using neural-networks with python and shell scripts

Motivation and Referenced code

I wanted to write a script (or a few) that would input a video and output a the video with original RGB removed and neural net generated colorization added.

This code was inspired by the code that was written by Sunita Nayak at BigVision LLC. It is based on the OpenCV project.

Satya Mallick post that sparked interest:

About colorize-video

  • Input: Color or B&W Video File (preferably '*.mp4')
  • Output: AI Colorized Video File The neural network recreates each frame's colorization individually

Youtube

Big Buck Bunny Click the image below to view in new window: Big-Buck-Bunny

Original

Original Big Buck Bunny Colorization

Colorized from Greyscale

Colorized Big Buck Bunny with Zero Knowledge of the Original Colorization

Greyscale

Greyscale Processed Frames

Requirements

FFmpeg

  • FFmpeg command line tools "A complete, cross-platform solution to record, convert and stream audio and video."

Linux (Ubuntu)

The simplest of all the land is our friend Ubuntu, where the following command would suffice for installation of ffmpeg library. Make sure that ffmpeg is in your bin path etc if you are unable to enter in terminal after restart or after reinvoking bashrc using "source".

$ sudo apt-get install ffmpeg

Mac OS (Homebrew)

The simplest way to install ffmpeg on Mac OS X is with Homebrew. Once you have Homebrew installed install ffmpeg from the Terminal with the following:

$ brew install ffmpeg

Windows

FFmpeg

Simplest way to get ffmpeg installed is to

wget (Windows only necessary step)

running getModels.sh requires 'wget' which is not native to Windows 10 "A command-line utility for retrieving files using HTTP, HTTPS and FTP protocols."

I used version 1.19.4 which was found here: https://eternallybored.org/misc/wget/ wget-1.19.4-win64.zip, wget.exe

extract the contents of the zip folder and add the directory containing only the extracted files to your PATH environment variables. start a new Command Prompt and the wget command should be available

$ wget --version

After entering the -V --version command you should see something similar to the following command prompt output:

GNU Wget 1.19.4 built on mingw32.
... *a bunch of versioning text*...
    /win32dev/misc/wget/out64/lib/libiconv.a
    /win32dev/misc/wget/out64/lib/libunistring.a -lws2_32
...*a bunch of versioning text*...
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
... *a bunch of licensing text*...

Navigate back to the 'colorize-video/' directory and run

$ getModels.sh

Python

I used Python 3.6.5, 3.6.2 and 2.7.15

Packages

Using pip https://pypi.org/project/pip/

$ pip install numpy
$ pip install opencv-python
$ pip install imutils

I found that Python 3 was necessary for cv2.dnn "dnn" module use in this step. Potentially needing:

pip3 install opencv-contrib-python

Structure

*models/*  contains the models used in this example we use Facial Landmark detection 68 points.
*images/*  contains images 
*greyimages/*  contains grey scale images for colorization
*greyimages/coloredimages/*  contains colorized images 

Installation

Open a terminal in the headpose directory and run (with sudo if needed on your system):

$ pip install -r requirements.txt

Now you should have installed the necessary packages

You still need to download the models:

#Specify the paths for the 2 model files
protoFile = "./models/colorization_deploy_v2.prototxt"
weightsFile = "./models/colorization_release_v2.caffemodel"
#weightsFile = "./models/colorization_release_v2_norebal.caffemodel"

# Load the cluster centers
./pts_in_hull.npy')

Give privilages to run the shell script to start application

$ chmod +x getModels.sh
$ chmod +x all_colorize.sh
$ chmod +x colorized_pngs2vid.sh
$ chmod +x pngs2vid.sh

Then run the shell script

$ ./getModels.sh

Sample Video

Original



Colorized from Greyscale



Greyscale



Usage

Process input video and output all frames in greyscale

$ python grey-video2images.py

Colorize all greyscale frames

I found that Python 3 was necessary for cv2.dnn "dnn" module use in this step. Potentially needing:

pip3 install opencv-contrib-python
$ ./all_colorize.sh

Compile new video of colorized frames

$ ./colorized_pngs2vid.sh

if using Windows:

$ ./colorized_pngs2vid_windows.sh

The colorization part of this code is based on and adapted by the code that was written by Sunita Nayak at BigVision LLC. It is based on the OpenCV project. It is subject to the license terms in the LICENSE file found in this distribution and at http://opencv.org/license.html

If you are interested in using Deep Learning Caffe Models with OpenCV: https://www.pyimagesearch.com/2017/08/21/deep-learning-with-opencv/

-Ross Mauck

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].