Showing posts with label Genealogy. Show all posts
Showing posts with label Genealogy. Show all posts

Saturday, 26 December 2020

AI: Colorizing Old Videos

It has been a couple of weeks since my last blog post, and that for a good reason (my second son arrived earlier this month).

I announced his arrival with some posts about some of his ancestors. One of the posts contained a video from the early 1950's.

There is a online tool (Jupyter/Python) that can colorize black/white photos and videos.

What It Does

DeOldify is based on Generative Adversarial Networks, where two Neural Networks compete to each other.  One Neural Network (generator) tries to produce realistic colorized pictures, and the other (discriminator) tries to tell whether pictures are authentic or colorized. The generator tries to fool the discriminator, and the discriminator tries to reveal the generator. When they work together, they will for example learn to create pictures that appear realistic to human beings.

DeOldify uses an extension of GAN that is called NoGAN. NoGAN eliminates some side effects of GAN for videos, for example flickering colors between frames.

You can find an interview with one of the inventors below.

How to  Use:

Step 1: I uploaded the black/white video file to YouTube. I wanted it to be available for deOldify but I didn't want it to be searchable yet, so I used the unlisted option. With the unlisted option, one needs the direct link to the video in order to see it.

Step 2: Follow the steps in deOldify Colab. One can run it in the cloud, or on a local computer, if desired. Provide the link to the video in step 1 when it is time to run the Colorize! step.

Step 3: The colorization can process a couple of frames per second, so this will take some time. Once the colorization is done, download the video file to your computer.

My original video:


My Colorized Video:

I added a small watermark in the lower left side of the video to indicate that this video has been post processed.



Sunday, 11 June 2017

TrafficControl: Modifying Existing Station QML Items from C++

The blog posts has been scarse, due to positive news in my closest family. I'll be a busy family man for the coming decades but I'll keep writing on this blog.

When something happens to a station in the C++ part of the program, the corresponding QML item shall be modified. I got inspiration from a post on Andrew Jones' blog, regarding QML/C++ interactions using signals/slots.

Train::move() will trigger signal that will be caught by the QML part and update the map.
  • A train enters a station
  • A signal is trigged by train::move(), containing the station name, the train name and a description of the event
  • A slot in the QML part recieves the signal and extracts the information.
  • The corresponding QML item is updated
The new signal is called stationChangedSignal, and will contain three qVariants:
  1. The first will always contain the name of the station that is changing
  2. The second parameter will define what has happened (in this case: "train arrival")
  3. The third parameter will define any other items/objects (in this case, the train name)
In this case, I'll let the train::runningToOpeningState() emit a signal:
stationChangedSignal("LundC", "train arrival",  "Hedy_Lamarr")

This signal will tell the QML part that a train named "Hedy_Lamarr" has arrived to the station LundC".

The current commit, 1c198ff, has introduced a signal without any parameters. I still have some problems parsing a signal containing qVariant data to the QML javascript. More about that in the next blog post.

Saturday, 19 September 2015

Genealogy: Anatomy of the ScanGed Python Script

The algorithm for scanning GED files is quite simple and it is based on recursion:

Start from a person in the family tree,
Collect the desired information about that person and print it to a a line.
Repeat for father, if found.
Repeat for mother, if found.

I've used dictionaries in Python, so that the script will know what line to look for a persons/familys section in the GED file. This will make the program much faster.

The source can be found on my public DropBox.


Monday, 31 August 2015

Genealogy: Creating Compact Ancestral Charts from Gedfiles

I've spent several hours doing some genealogical research for my ancestors. The most interesting finding so far is a remote relative (my mother's cousin's grand-grand-grand-grand-grandfather Caspar Mathisson), who was the pilot onboard the ship when the ship ran aground half a mile900 m from Göteborg in 1743 after a trip to China. https://en.wikipedia.org/wiki/G%C3%B6theborg_(ship)

Using Ancestry.com, and the Gramps software, I've found lots of persons back to the 17th century. 

However, I lacked one visualization tool for the shoe box situation: 
Often, one very proactive person does a lot of research. After a while, the results will end up in a shoe box on the attic for some decades. In the case of papers and photographies, it is easy to resume the research. In the case of data files, it will be much harder (just imagine how to retrieve data from a computer of the '80s). Therefore, the data must be in printed form, independent of computers or programs.

On the other hand, a family tree will be hard to read if  there are many persons in it. And printing a 100-person GEDCOM file will require 40 pages, and that is too much. 

I'll print the final results of the file now (for privacy reasons, this example starts with my grand-grandfather) and I'll describe the function and anatomy of the program later: