Skip to content

vishalsingha/Colorme

Repository files navigation

Colorme is a image colorization project which takes the black and white images as input and return the colored image as the output of the model.In this project we have taken taken 100K colored images and built a model using pretrained VGG16 model as a base model for feature extracture and than added few set of Conv2D and UpSampling 2D layer to get the output image.

Dataset Source:

The Dataset used in the training of model is taken from Kaggle from two differnt places. LAter they have been merged to train the model.
Dataset1 : https://www.kaggle.com/darthgera/colorization
Dataset2 : https://www.kaggle.com/yehonatan930/flickr-image-dataset-30k

All the colored images were converted from RGB to LAB color channel. Further L channel is used as input to the model for predicting the AB color channel. Since the VGG16 takes 3 channel image as input, so the L channel have been copied three times to make input as three channel and fed to te network for the predicting of AB channels.

Model Artichecture:

Model artichectre is made by adding pretrained VGG16 layers(up to 19 layers) and after that I have added Conv2D and UpSampling2D layer alternatively.

The Yellow layers are the pretrained VGG-16 layers.
The gray layers are Upsampling 2D layer
The skyble layers are Conv2D layer.

Results:

                                                Input grayscale Image                                       

                                               Output Colored Images                                       

Deployment:

Using flask:

Colorme webapp for the demo purpose is deployed via flask framework. For increasing the speed of the model regular tensorflow model was converted into Tensorflow Lite which increase the latency of the model much.

# convert to tflite model
converter = tf.lite.TFLiteConverter.from_keras_model(model)
converter.allow_custom_ops = True
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_types = [tf.float16]
tflite_model = converter.convert()

Deployment link: http://bw2c.herokuapp.com/

Using flask on top of docker container

  • Made Dockerfile by using prebuilt anaconda image from dockerhub and deployed on heroku [SEE Deployment]
From continuumio/anaconda3:latest


WORKDIR /app

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .

CMD [ "python3", "app.py"]

To Do list

  • Model Training
  • Deployment through flask
  • Conversion of regular tensoflow to tflite and deploy
  • Deployment via docker

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages