Author Topic: Coloring a B&W photo  (Read 5462 times)

0 Members and 1 Guest are viewing this topic.

Chris333

  • Crew
  • *
  • Posts: 18392
  • Respect: +5662
Coloring a B&W photo
« on: April 06, 2020, 05:25:36 PM »
+3
I had seen a few people using AI to colorize old photos. It somehow takes known parts of a photo to figure out the colors. I think it works like this. If there are trees in the photo it knows those are green and from there can figure out the rest of the photo.

So I tried it on a photo I knew what the colors should be. In this pic the loco should be yellow and the cars red:







The program is called DeOldify:
https://github.com/jantic/DeOldify
https://deepai.org/machine-learning-model/colorizer

peteski

  • Crew
  • *
  • Posts: 32930
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5334
    • Coming (not so) soon...
Re: Coloring a B&W photo
« Reply #1 on: April 06, 2020, 05:30:39 PM »
0
That's pretty slick!
. . . 42 . . .

Chris333

  • Crew
  • *
  • Posts: 18392
  • Respect: +5662
Re: Coloring a B&W photo
« Reply #2 on: April 06, 2020, 05:40:58 PM »
0
Now for the smarter people here... how do I install this on my PC?

CRL

  • Crew
  • *
  • Posts: 2332
  • Needs More Dirt.
  • Respect: +636
Re: Coloring a B&W photo
« Reply #3 on: April 06, 2020, 05:53:26 PM »
0
Nice find.

DKS

  • The Pitt
  • Crew
  • *
  • Posts: 13424
  • Respect: +7026
Re: Coloring a B&W photo
« Reply #4 on: April 06, 2020, 06:51:43 PM »
0
Don't let Ted Turner know about this. He'll want to colorize the black and white parts of Wizard of Oz...

wazzou

  • Crew
  • *
  • Posts: 6727
  • #GoCougs
  • Respect: +1656
Re: Coloring a B&W photo
« Reply #5 on: April 06, 2020, 09:24:12 PM »
0
Don't let Ted Turner know about this. He'll want to colorize the black and white parts of Wizard of Oz...


Already been done unless of course that was the sarcasm font.   :D
Bryan

Member of NPRHA, Modeling Committee Member
http://www.nprha.org/
Member of MRHA


Chris333

  • Crew
  • *
  • Posts: 18392
  • Respect: +5662
Re: Coloring a B&W photo
« Reply #6 on: April 06, 2020, 09:46:30 PM »
0
Well part of that movie is supposed to be in B+W. If you search YouTube for DeOldify you can see a few war movies that have been converted.

learmoia

  • Crew
  • *
  • Posts: 4215
  • Gender: Male
  • ......
  • Respect: +1043
    • Ian does Model Railroad stuff on Youtube.
Re: Coloring a B&W photo
« Reply #7 on: April 06, 2020, 11:49:07 PM »
0
I ran a few photos through it.. and unless it has wide range of 'known' colors to assume, it has a hard time rendering colors.

It would be nice to have an eye dropper so we could tell it known colors.
For example.. It doesn't know Brown and Orange..
[ Guests cannot view attachments ]
(from Railpictures.net)
https://www.railpictures.net/photo/652974/

Chris333

  • Crew
  • *
  • Posts: 18392
  • Respect: +5662
Re: Coloring a B&W photo
« Reply #8 on: April 06, 2020, 11:51:01 PM »
0
Yeah I tried a photo with a orange and green loco, it didnt figure it out.

Chris333

  • Crew
  • *
  • Posts: 18392
  • Respect: +5662
Re: Coloring a B&W photo
« Reply #9 on: April 07, 2020, 04:13:08 AM »
0
Seriously does anyone understand any of this ?

Quote
How to setup DeOldify
For those looking to try this themselves, here is a short tutorial on how to get things setup.
First, cd into the directory you would like to place DeOldify, then clone it:
git clone https://github.com/jantic/DeOldify.git DeOldify
Now cd into the newly created DeOldify directory and create a new “models” directory for your pre-trained weights:
cd DeOldify
mkdir models
You can now download the pre-trained weights through the command line:
wget https://www.dropbox.com/s/zkehq1uwahhbc2o/ColorizeArtistic_gen.pth?dl=0 -O ./models/ColorizeArtistic_gen.pth
If you don’t have wget, you can find links to manually download these pre-trained weights in the DeOldify README.
We also need to install dependencies:
pip install -r requirements.txt
Once the dependencies are installed, open the project in a Jupyter Notebook:
jupyter notebook
At this point, you should be able to open the ImageColorizer.ipynb file and continue from there. I hope this helped! Happy colorizing!

Chris333

  • Crew
  • *
  • Posts: 18392
  • Respect: +5662
Re: Coloring a B&W photo
« Reply #10 on: April 07, 2020, 04:16:21 AM »
+1
This one came out pretty good:


Simon D.

  • Crew
  • *
  • Posts: 187
  • Gender: Male
  • Respect: +50
Re: Coloring a B&W photo
« Reply #11 on: April 07, 2020, 05:30:42 AM »
0
Oh dear, someone left them out in the sun too long...

MK

  • Crew
  • *
  • Posts: 4064
  • Respect: +772
Re: Coloring a B&W photo
« Reply #12 on: April 07, 2020, 08:47:37 AM »
0
Seriously does anyone understand any of this ?

Quote
How to setup DeOldify
For those looking to try this themselves, here is a short tutorial on how to get things setup.
First, cd into the directory you would like to place DeOldify, then clone it:
git clone https://github.com/jantic/DeOldify.git DeOldify
Now cd into the newly created DeOldify directory and create a new “models” directory for your pre-trained weights:
cd DeOldify
mkdir models
You can now download the pre-trained weights through the command line:
wget https://www.dropbox.com/s/zkehq1uwahhbc2o/ColorizeArtistic_gen.pth?dl=0 -O ./models/ColorizeArtistic_gen.pth
If you don’t have wget, you can find links to manually download these pre-trained weights in the DeOldify README.
We also need to install dependencies:
pip install -r requirements.txt
Once the dependencies are installed, open the project in a Jupyter Notebook:
jupyter notebook
At this point, you should be able to open the ImageColorizer.ipynb file and continue from there. I hope this helped! Happy colorizing!


Those look like a bunch or Unix of CP/M commands.  I'm sure one of our many resident computer geeks can figure it out.  I'm a bit too rusty at this time.

peteski

  • Crew
  • *
  • Posts: 32930
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5334
    • Coming (not so) soon...
Re: Coloring a B&W photo
« Reply #13 on: April 07, 2020, 04:26:52 PM »
0


Those look like a bunch or Unix of CP/M commands.  I'm sure one of our many resident computer geeks can figure it out.  I'm a bit too rusty at this time.

Looks like Unix (Linux)  shell commands to me.
. . . 42 . . .

Doug G.

  • Crew
  • *
  • Posts: 1099
  • Gender: Male
  • Respect: +43
Re: Coloring a B&W photo
« Reply #14 on: April 07, 2020, 05:22:34 PM »
+1
I want to know Toto's real color.

Doug
Atlas First Generation Motive Power and Treble-O-Lectric. Click on the link:
www.irwinsjournal.com/a1g/a1glocos/