Revive Your Old Images and Videos with Colorization using DeOldify and Python Deep Learning

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is Ashwin here in this video we are going to see how to colorize black and white images using deol defy so deol Defy is a repository and contains the modules which we can use it to colorize black and white images so we will see uh how to colorize images and videos in this project so I'll also change the title colorize images and videos okay I already set the run time to GPU and I have already uh uploaded a few files black and white files here and anyway I will doing a comparison between the original and the colorized images so let's download the uh module from the GitHub so we can display everything using this requirements they have like set up everything now CD -oldify old if I okay we have changed the directory so this is the directory we have downloaded now paper install r olab requirements because we are running it in collab and I will say quiet so this will give us less information so this will be installed if I and apart from this we also need to download modules that we need so we'll be uh doing that after this we will also like import the modules import modules first from deol defy d o d Phi import device so we are in like using GPU Mission so we will set up like GPU from deol defy Dot device ID import device ID device ID so this is the base thing we will set the device ID here device dot set device equals device ID Dot gpu0 so we have only one GPU that's why I am setting jpu 0 if you have like multiple gpus so you can set any GPU that you want so run this we will create like few cells and you can see that GPU 0 is assigned now we can import the remaining modules so from deol defy dot visualize visualize import Star so this will contain like all the modules that we'll be using and apart from that we will import warnings warnings Dot filter warnings ignore let's run this thing now that the import modules is done maybe before that itself we will download the models that we need download s I will create a new directory mkdr models should be in string so this is the model from data.dpai I'm just getting this artistic model there are few other modules for uh video and stable so this one is like uh giving good results compared to the other one so video is for uh if you are using video as input means I will be using the other module so we will be saving this model in models uh color artisticgen.path let's download it okay so this is downloading okay now the model for artistic is done so this is for uh the video let's run this and this will be done quickly now that we have imported all the more modules Also let's uh start the project colorize or deodify images d oldify images there are also other modules that you can use to colorize the images but apart from all the things this one performing uh much better so that's why I'm using this one so colorizer equals get image I'm not sure like why it is like suggesting very slowly get image colorizer of artistic artistic equals true so this will uh import the module model that uh we have downloaded let's run this now we have like set up a few parameters first one is like render Factor so this depends uh on the quality it can be arranged from like uh for uh fast results that you can have like 15. for uh better results you can have it as like 40 by default we can go for like 35 which is like in between so I'm setting like 35 now image path equals colorizer Dot okay this is still running Let's uh complete this plot transformed image transformed image path you can also get it from URL as well so currently I am using some local files to test it if you have some particular URL means uh you can use URL maybe I'll just show that function itself here so now you can see the suggestion plot transformed image will give you the capability to use the local files plot transformed image from URL you can use the URL directly to fetch the image and do the transformation so this model is using a resnet model in the back end as well so let's continue with it image I will specify the path so here slash content slash BW test1 Dot jpg and we have the render Factor render Factor equals render Factor and compare compare equals true that's pretty much it and after that show show image in Notebook so this will just show you the image in the notebook if you are running it in The Notebook pass the image path that we have transformed run this so higher the render Factor it will take like more time and this artistic is so far like performing very well I have tested out like three images let's also like copy and paste this just change this to and uh three let's also run this see this is actually a black and white image that is converted to colored image you you cannot uh tell any difference right the sky is good it is like a Cloudy and even the bold colors are like very well defined everything is like accurate to the sage even the windows and buildings everything is like very well uh defined all the colors are like accurate so this is the black and white image that is their input and this is the colored image that is the output so you can see a clear comparison like how it is working now this is another uh image so you can see the dark clouds light clouds and even the sky and you can see the mountains with the shades and these are all like trees with the path so you can see right all these things are like it's difficult to interpret if you don't have much idea but okay it didn't display the comparison yeah here it is the comparison so this one you can see all the differences and it colorized very well see this is again a cloudy Forest path and uh it defined all the colors very well so last one is like City area so uh we have like a different uh building rooftops uh even it has like orange colors and everything so this is the black and white uh image and this is the result that we have got see how much uh clear and accurate uh everything with the colors so you could convert any black and white image to a colored image most of the results are like a very well defined so this is for like uh converting images uh let's see how to convert videos D old if I videos now I will again Define the colorizer colorizer or video colorizer video colorizer equals get video colorizer okay it's not suggesting again okay get video colorizer run this it will also download again some rest net model okay this is using resnet why not one before it was a restaurant 34 again here also I am setting the render Factor because I don't worry about the hardware Hardware is uh Google is providing us so we could run this it will process frame by frame and you can also stream this uh thing in like real time uh it will just process uh frame by frame and it will render the uh frames so video path video path equals video colorizer dot colorize from file name or URL I am using file name so again file name file name equals the path so slash content slash b w test video dot let me just check MP4 MP4 and I will pass the render Factor render Factor equals render Factor okay I think that's enough we will also try to show the video last time I ran I didn't work very well show video in Notebook pass the video path here let's run this so this particular one will take some time depends on the length of the video if you want to process the result much faster means you could mention the render Factor uh very less but it will affect the quality I'll just uh keep it as like 35 or 40 for better results now the process is started it will take like a couple of minutes only okay now this is the video you can clearly see this is like a black and white video I will show you the original video as well how it is like colorized everything including the people car so this is the video I am talking so even the faces like slightly like uh it is like changing but overall uh it feels like a captured from a colored camera let me show you the actual footage so this is the actual footage I have downloaded and used for the test video so this is the black and white video you cannot like uh clearly assume uh like what are the colors uh with these things but uh it had uh produced the result very well now this is the result we have got you can see how powerful the model is so that's pretty much it guys uh using this approach you can uh bring back to life any uh old photos or videos that you have if you have any queries on this please leave a comment below I will definitely uh answer that apart from that if you like this video hit the like button and don't forget to subscribe the channel for more videos like this see you guys in the next video
Info
Channel: Hackers Realm
Views: 2,025
Rating: undefined out of 5
Keywords: colorize black and white photos, colorize images and videos, deoldify, deoldify colorization, deoldify tutorial, deoldify video tutorial, deoldify python, how to colorize black and white photos, colorize black and white, restore old images ai, restore old images and video, colorize image, colorize video, deep learning, machine learning, tutorial, hackers realm, colorization, python, image processing, video processing, computer vision, neural network, artificial intelligence
Id: B1OK6cUfAIc
Channel Id: undefined
Length: 15min 38sec (938 seconds)
Published: Thu Mar 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.