How do I use this? First of all, this neural net runs on python with opencv and imutils so you'll have to start by installing those libraries first. You can just use pip for that:
pip install opencv-python pip install imutils install pip if you don't have it
How do I run the model? Just type the following in a console, inside the folder containing the .py files:
After that you'll be shown with two windows, one showing the original image and the second showing the colorized image, you just have to press any key to close both windows but remember to right click on the image if you wish to save it.
WARNING: Video files can be very heavy to process But if you want to give it a go then you should just run: python bw2color_video.py \ –prototxt model/colorization_deploy_v2.prototxt \ –model model/colorization_release_v2.caffemodel \ –points model/pts_in_hull.npy \ –input images/your_video.webm
This one should give you a look at the colorized frames, those frames will be stored in a folder called frames and you can join them to make a video with the "make_video.py" file, just remember to adjust the framerate.
Welp it's getting pretty late for me, I'll continue tomorrow and also I'll figure out a way to get past 8ch's retarded file uploader to show a video I processed.
Some of these results are obviously shitty. You could crop parts that didn't work properly and try that piece seperately.
Andrew Hughes
I already tried that with many images but the result was either the same or even worse, the thing is, this neural net needs a lot more training samples and time, I'm pretty much testing it on every image I can find and seeing what happens.
Can we retrain the model? Use the one they have as a base but feed it a bunch of moden re-enactment photos.
Dylan Gray
Yes, you can do that, all you gotta do is call all the components of the model that were saved in the last checkpoint (the files in the model folder) and run a training session with new images to feed the network. The only problem is that I don't know yet how to do that with caffe models, gonna have to study that.
David James
Does it work like deepfakes? Used to have that pumping for a while.
Aiden Ortiz
Close to it, this model uses a simple Encoder -> Decoder architecture, which honestly doesn't give too good results, however it is more faster and less expensive than what deepfakes use.
Deepfakes use GANs (Generative Adversarial Networks) to create their output, in short, it consist of one network creating fake data and another network inspecting said data and determining if it's real or fake, you basically have a network training hard to jew the other one to output a fake image that looks legit to us. This the kind of network I'd recommend for the colorization problem, it would give better results but as you've might imagined it requires a ton of GPU power and millions of samples.
Nathaniel Gray
This is really cool OP, thanks for sharing. It seems blurry spots and skies don't always turn out well but overall it is very impressive technology. Posting some of the better ones.
Thank you too, those are nice results. The model also has trouble whenever there are too many faces together. But it somehow recognizes trees and leaves quite easily.
Alright these will be the last ones from me, I gotta go, whoever wants to give it a try just toy around with the files I shared and post your best results.
Just a reminder, each argument must be called with double '–'
Benjamin Ramirez
That one came out nicely. They look ever more patriotically stimulating in colour.
Thomas Murphy
I've been fucking around for 45 minutes or so and can't figure this python shit out. sorry lads, can't contribute due to retardation. thanks for the great work.
@echo off set /P id=Enter image name: python bw2color_image.py –prototxt model/colorization_deploy_v2.prototxt –model model/colorization_release_v2.caffemodel –image images/%id% –points model/pts_in_hull.npy pause null
in the folder containing the bwtocolor_image.py file and run the batch file. Then run the batch file and type in the name* of the image you want to convert. *include the .jpg, .png, etc at the end and make sure the image is in the images folder.
>File "bw2color_image.py", line 5, in Thanks anyway user but i'm still too retarded. I've gone back and looked through the command and everything and don't know what the fuck this "numph" thing is. I found a site that does it pretty good online though. see pic related.
on the second to last line of the file. 3) Use the script I previously posed and watch as all of your colorized images are saved in the color_images folder without the snipping tool.
Have Fun & Heil Hitler
Hudson Miller
Didn't work bro. I didn't have PIP so i got a file online "get-pip.py" and installed that with python. it came up that it had been added and everything but i still get the same error when running your script from earlier about "numpy". not sure what i'm going wrong.
Hunter Watson
What version of python are you using? The most stable from what I remember is currently 3.5.2
Noah Lewis
3.7.3 I will try out with 3.5.2 but then I'm giving up (kek) appreciate your help though user and not laughing at me and calling me a faggot for not understanding
its not in your PATH system variable. you'll need to add the pip executable's path to your system's path so your cmd knows where to look for it. quick google search for "add python to system path" will work for you.
nah mate, i changed the directory manually when i was seeing if i could get it to work or not. thanks for that though, i will keep it in mind for other useful cases.
Gabriel Murphy
Here is a link to the modded on if you didn't do it already.
What's the problem? You throw a lasso around the not colored part you want colored and select to colorize. Pick your color. I'm talking in Gimp. Maybe Photoshop has similar methods.
For example. You didn't get Hitler's sleeve. So I lassoed his sleeve and colorized it. Hue 243 Saturation 9 Lightness -48. You do this for each individual color. It's time consuming of course. Not automated.
At least the lasso algo is automatic, somewhat. That's what makes it possible, really, though someone probably did one pixel by pixel with windows 3.1 or the like.
No shit bro. I tried working on a image yesterday and was doing it color by color. It's going to take time if you want it done properly (pic related was a half hour or so). This algorithm is certainly not perfect; it does make the images look better though. It's not supposed to be perfect, yet, until the AI gets better anyway. For now though, this gets the job done quick and makes a vast improvement on the initial b&w image.
Images in black and white usually feel 'disconnected' from people living today in a sense. If we took images of Hitler's Germany and gave them color it would actually go far in humanizing a nation and a man who has been dehumanized by history. see
Carter Cruz
Appreciate the pics very much.
Jack Murphy
This is great
Owen Clark
This is true, and I initially assumed it was the point of this thread.
I get "is not recognized as an internal or external command" etc. with:
??
Grayson Rivera
Show the exact command you run Show contents of pwd Which OS are you using? If you pasted from here make sure to replace the weird unicode dash with two dashes