tomhoag / congress-look-alikes

A quick hack to see how much congress looks alike

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Congress Look Alikes

So how much does congress look like itself?

Using the resources found @ https://github.com/unitedstates/images & https://theunitedstates.io/ and making use of opencv, dlib and face_recognition and a few other libs, some code from Adrian and Adam, I cobbled together this little project.

The results might still be available:

Current and past members of congress

Current members of congress

Methodology

Using the roster of all current and past congress people (https://theunitedstates.io), any congress person that has a image available is encoded and saved with some other meta info in the pickle file.

Using the encoded faces, each image is then compared to all of the other images. The comparison is run multiple times, tweaking the tolerance value used with face_recognition. If an image matches at least one other image (other than itself), the match(es) are displayed on the output page.

While the initial pretext of this exercise is to discern the similarity among congress people's images, it quickly becomes an exercise in overfitting the solution to the data.

Run the code

You can run the code yourself too -- you will need to install the dependencies into your python environment -- sorry no requirements file at the moment.

face_recognition, os, json, urllib.request,pickle, numpy, argparse, imutils, cv2, string

python match.py -h will then help you get started

About

A quick hack to see how much congress looks alike


Languages

Language:HTML 99.9%Language:Python 0.1%