Skip to content

ml-and-video/RealTimeNeuralStyleBeautify

Repository files navigation

RealTimeNeuralStyleBeautify

Theme Chosen

AI in Entertainment through Neural Style Transfer deployed in real time video capture with different styles.

Project Description

We used OpenCV to capture real time videos and take snaps of every frame and processed each image by normalizing it and resizing it according to our input dimensions and processed it in the style of the input chosen by the user.

To implement this in a user friendly manner, we have created an application using Tkinter module in Python. The user has choice to either select his/her own image by specifying a directory path and then selecting any given style. Also, they can select to capture a real time video with their desired style using the same application. We also implemented a small web application for the same (https://github.com/raghav275/Neural_Style_Transfer_Website)

Here is a view of the application developed using Tkinter: alt text

The user has to copy the directory to the path of the image along with it's image name and insert in, and click on submit: alt text

The results are like below:

Before Transformation:

alt text

After Transformation:

alt text

On Person (before):

alt text

On Person (after):

alt text

How our project stands out against the other exisiting solutions or products?

We implemented a real time neural style transfer that captures both image and video. The existing products work only on static images. We have extended the idea to different platforms like Desktop and Website (linked above).

Optimizations

Due to limited computational power we have tried to incorporate maximum smoothness as possible by normalizing the image, compressing it, resizing it and also by making sure that only the previous frame gets processed so that the buffer is least and frames per second increases.

Future Scope

We aim to extend this implementation to many styles and further do better optimizations to increase the frame rate as well as the resolution. We also aim to make the GUI more user friendly and robust. We want to deploy this on Android using TensorFlow Lite in future, so that it becomes more wide spread and more easily accessible by the general public.

Installation:

• Dependencies:

  • OpenCV (opencv-python==3.4.2.17)
  • Tkinter

IMPORTANT: To use the pre-defined weights you need to run the shell file (.sh) inside the models folder to download the .h5 files for different styles.

Then, to run the script from terminal just use: python3 tkinterProgram.py `

About

Neural Style Transfer using OpenCV Real Time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published