Thursday, February 19, 2009

Fooling around with face-recognition software

I should be working today, but I had to play around with this "which celebrity do you look like" application.

I uploaded some pictures of myself and got some very strange results. Then I uploaded a couple pictures of my wife (she wanted to play, too) and it only recognized two of the four pictures of her. I guess it doesn't like profiles.

Then, my wife suggested I try it with a picture of Emily the Strange (this picture, in fact), but it didn't recognize a face at all.

Which isn't surprising--that's a very basic representation of a human face.

Well, this got me to thinking...what would my very own comic-book heroine Locus look like?

I submitted this picture:



And again, it didn't recognize a face at all.

So I started thinking about colors and such, but especially file size. I did a quick, 10-minute sketch of Locus in a straight-on, boring face shot. The kind of thing she'd have on her driver's license:

(note that these drawings are all scanned in at full color and 300dpi, in order to give the recognition software more data to work with)



I wasn't expecting it to recognize a thing, but it did! It gave some interesting matches, too:



Now I was getting interested in how this thing worked. It actually picked up some quick and sloppy pencil work. What would it do with old-school black & white inks?



Here's what it gave back to me after thinking about it for a minute or so:



At this point, I was having a lot of fun. The next logical step was color. Nothing fancy--I should be working, after all. So I stuck some quick flats behind the inks.

(If you've never heard the term, "flats" means a flat base color which a colorist uses to block off major shapes for coloring later)

Note that these are the base flats I use to color Locus in the comic.



And here's what the software spit back out:



Very interesting.

I decided to do a quick coloring job--just modeling the forms as quickly as I could. I really didn't spend more than five or six minutes on this. Used a lot of Color Dodge (brush set at 19%). It's nasty-looking, but this is what I ended up with:



The software couldn't recognize a face anymore. It must've been the awful job I did on the left side of the face (her right side, if that makes more sense to you). I really didn't do that cheekbone right.

It also might've been the inks, I thought. All that weird cross-hatching might've made sense to the program when it was just black and white or flatly-colored. So I touched it up a bit and removed the inks altogether. I also added a very basic gradient background to sort of half-ass show where the light was coming from. I figured I'd help the software out a little that way.

And again: this isn't a very good piece of art. I'm experimenting here--trying to see how this thing thinks--not trying to make an actual portrait.

Besides, I really should be working right now. :)



I uploaded the inkless Locus and...it recognized her face again! Here's what it gave back to me:



At that point, I realized it was getting late in the day and I should knock it off and get back to work.

This was a fun experiment. Educational, too. Note the duplicates:

Jessica Simpson showed up in the pencil and ink results, with 66% match for the pencils and 66% (again) for the inks.

Aishwariya Rai shows up with a 70% match with the pencils, but disappears from the results until I put flat colors behind the inks. Then she returns at a 68% match.

Alicia Silverstone matches the inks at 67%, and the flat-colored inks at 73%.

The final image (as terrible as it looks) manages to match with Billie Piper and Helena Bonham Carter, which is interesting. I never noticed Locus bearing a resemblance to either of those two ladies, but now that I look at it...

Then again, that final image "matches" some very weird photos--like that black & white almost-profile of Oscar Wilde.

At some point, I think I'll try this again--but not till I have more time to do a better job. Something painterly, maybe. Who knows?

Also: I really want to try this with Spook now. Really bad. :)

2 comments:

alanajoli said...

Man, this is way more fun than just casting actors into the roles. Have a computer pick the look-alikes! :)

Adam Black said...

Hi Alana!

I'm glad you found my blog. :)