Debugging Art

A journal of ongoing adventures in creative pursuits through computers

← Back to Sketch

Notes on: Dva Brata, Dva Brka

This side of the family finds no occasion too small to bring out the Balkan props, like this Lika cap my brother is wearing in the photo. More often than not it's accompanied by the rakija we've collected from relatives in our trips to the Balkans over the years. The whole thing is actually an interesting story that's resulted in some colorful anecdotes and heart-warming stories over the years.

This winter my brother and I decided to grow mustaches together. He led the way with an earlier start in November. The end result accentuated the Likan headwear perfectly. No doubt our Serbian relatives will be pleased when this thing inevitably makes its way to Facebook.

This sketch started organically: I just wanted to play with the Shape Detection API to find faces in an image. I recently learned about the API at FrontMania from a talk given by Piotr Ilczuk while I was there giving my own talk — JavaScript for Artists. Most of the focus of his presentation was on using TensorFlow.js which I found interesting, but when he showed the audience how you can enable experimental web platform APIs in Chrome to use the Facial Recognition API without having to train or download huge models I was really excited! Somehow I'd completely missed any and all new about this feature.

This sketch set out to do a few things:

The last part didn't exactly pan out. The landmark locations (i.e. eyes, nose, mouth) are identified in the object returned by the API. Coordinates for each landmark are provided as an array. I'd seen other examples that placec points at these coordinates and the general result is you can see a decent outline of where the feature is on the face.

In all of my tests though the points seem to collect in the middle of the face, almost randomly. The examples I followed are all very straightforward, so I don't think I've overlooked anything. The pixel coordinates for each landmark are different and perhaps very generally located in the directions you'd expect them to be relative to one another, but the vary by a very small handful of pixels. This behavior seemed consistent with every image I tried.

So, after a wall, I chocked it up to bugginess and probably one of the reasons enabling this feature is buried in the chrome:flags page and turned off by default. Maybe some day I'll come back to this sketch and it will start working.

In the meantime I did the next best thing: made a general guess about where the eyes should be, blacked them out like it was a redacted document and added silly texdt between each of our detected faces to assert thte title Dva Brata i Dva Brka lived up to its name: jedan brata i jedan brka, each.