MLNI Midterm (Research + Progress Towards Final) Healing Henna– Eszter Vigh

Inspo
I wanted to have generative art that mimicked the step by step creation of the henna designs.

Inspiration:

So growing up, a lot of the women in my family on my father’s side got diagnosed with cancer. My aunt nearly died of cervical cancer when I was eight. My cousin was in and out of remission for stomach and liver cancer from the time I was about seven till I was fifteen when she ultimately passed away. The four year anniversary of my cousin Judit’s death was September 28th, so I had been thinking of her a lot prior to the midterm. When it came to creating something for the class, I knew I wanted to do something that honored her and sort of helped me work through what I was feeling. 

Inspo
Project Inspiration (that awesome lady to my left)

Sure, there is risk in doing something deeply personal. But it also helps you understand the level of interaction and helps you make it tailored to your target audience. 

Background:

example
The ultimate goal (probably achievable by the time finals roll around)

So, ideally I want to use ml5 to find the edge of a person’s head and then draw flowers that generate on that edge… now I think realistically it would make sense to generate some of those vines around the edge, just to make the image look less pixelated around the edge. So outline of the person is vines.. then at the end of these vines there is a flower that is made out of dots and kind of mimics the henna dot designs. 

first sketch
Vine and Floral Ideal

Please excuse my drawing ability. But essentially this is what I want the final to look like in some capacity. I’ll show how close to this I got in the midterm and also explain the critiques and what I hope to accomplish for the final. 

The Process:

Plan
This plan… didn’t include a ton of other steps that popped up as a result of this steps..
  1. Using BodyPix or UNET find the edge 
  2. Count the pixel area of the body 
  3. Average the pixels to find the midpoint, so that the vines are all relative to the midpoint. 
  4. Draw all of the flowers and the vines in p5
  5. Place the p5 elements in the ml5 sketch 
  6. Have the vine draw first 
  7. Add the flowers to the endpoint of the vine
  8. Celebrate because this seems feasible in one week!

Step 1:  BODYPIX OR UNET

BodyPix“Bodypix is an open-source machine learning model which allows for person and body-part segmentation in the browser with TensorFlow.js. In computer vision, image segmentation refers to the technique of grouping pixels in an image into semantic areas typically to locate objects and boundaries. The BodyPix model is trained to do this for a person and twenty-four body parts (parts such as the left hand, front right lower leg, or back torso). In other words, BodyPix can classify the pixels of an image into two categories: 1) pixels that represent a person and 2) pixels that represent background. It can further classify pixels representing a person into any one of twenty-four body parts.” (ml5js.org)

UNET“The U-Net is a convolutional neural network that was developed for biomedical image segmentation at the Computer Science Department of the University of Freiburg, Germany.[1] The network is based on the fully convolutional network [2] and its architecture was modified and extended to work with fewer training images and to yield more precise segmentations. “(ml5js.org)

So… I was going off of these definitions (that’s why I put them above)… it made more sense to use BodyPix since that’s a) what I used for my last coding homework, b) seems like it would be better at finding the overall area (I’m not looking for individual parts… which seems to be what UNET is tailored to do). Moon also agreed that BodyPix was better… at first I thought maybe it would be worth to do both in order to make the output outline of the person less pixelated, but if I am covering the edge up with a vine later anyway, do I really need UNET? I decided I didn’t and moved forward with BodyPix. 

Step 2+3: BODYPIX CALCULATIONS 

seg,ent
Segment does not mean Segment with Parts

What does it mean to segment? Segment means you are looking for the body outline itself, so not the individual arm, face, etc. 

rect
Drawing the actual gird size and scaling it… the scaling ruined everything

It looked great… up until it was scaled, then I had these big ugly square edges, but at the time I thought, eh not a big deal since I’m covering this with a vine. But the image had to be bigger, so I had to do what I did. 

Step 4: DRAWING FLOWERS + VINES

calc
Throwback to Calculus

My favorite part of Calculus is not doing Calculus. But of course, flowers are circular, therefore it was time to revisit the Unit Circle. Below I’ll link all of the raw p5 code so you can see that the variation really come from adjusting the angles at which the sketch starts and ends. 

Flower 1

Flower 1
 Flower One

Flower 2

flower
Flower Two

Flower 3

flower
Flower Three

Flower 4

flower
Flower Four

Flower 5

not flower
Flower Five (that isn’t actually a flower)

Flower 6

flower
Flower Six

Flower 7

flower
Flower Seven

Flower 8

Flower
Flower Eight

Flower 9

flower
Flower Nine

Vine

vine
The Vine

The key difference between the vine and the other flowers is the mention of “noise” in the vine code. This means that the vine is different nearly every time you run the sketch and allows for a more organic, not nearly as neat and arced style as the flower have. 

As I was admiring the vine, I realized it would be interesting to have it become sort of a necklace. I remember that one of the issues my cousin was facing towards the end of her life was shortness of breath, I thought maybe placing the vine there would be symbolic. This meant I wasn’t going to actually draw the vines around the body. 

Now, a note on how to draw these graphics. This is apart of the create grpahics/PGraphics method present in both p5 and processing. Now the point of doing this… is the whole pixelated body outline is on the bottom most layer of the sketch. In this case, I drew another layer on top of this with the vine and the flowers. This method makes it possible to clear the sketch… this is a functionality I will explain in a little bit.  The only thing that’s very odd still about this whole PGraphics thing is the fact that the canvas for that has to be large, and actually larger than the video output itself in this case. (This is another reason why I had to scale up the video and make the background pixelated)

STEP 5+6+7: PLACING ELEMENTS INTO THE ML5 SKETCH

solution
Individualized FrameCounts for All!

So, it became apparent that using just plain frame count was going to be a problem. The issue was the flowers and vines couldn’t be drawn forever because that would eventually just yield a circle. So I was using frame count to control how many times the sketch would run. The issue was because the vine and the flowers were using frame count too, the sketch would stop before the flower reached maturity. This seemed to fix the issue almost completely. 

The vine was in a function completely independent from the flower drawing function which  took the ending point of the vine as an input. 

STEP 8 + 9: BETTER USER EXPERIENCE WITH PAGE CLEARING + VOICE CONTROL

test 1
New Flower Draws When I Clear it Out
UGH
New Flower Draws When I Clear it Out
clear screen
Clearing It
redraw
New Start

So I was thinking about how to clear the sketch as painlessly as possible. To me it made sense to clear it if there wasn’t enough of a person in the camera field. That’s exactly what I did with pixel counting, setting a reasonable threshold to clear the vine and the flowers, an example of which can be seen above. 

When it came to growing the vine, it made sense considering the user has the vine positioned around the neck that speech, specifically volume controls the growth of the vine. Almost like this idea, that the more you struggle the worse it gets… this is also something that is possible for cancer patients to use even because it doesn’t require significant effort like movement would. 

STEP 10: ACTUALLY CELEBRATING (BUT CRITIQUING MY WORK) 

So what’s wrong with my project? Many things. I think I want to rework the vines to work around the outline and then have the background and the filling of the body be the same color. 

failure
The style just isn’t the same

The other issue is that I didn’t like the sizing of the graphics, but if I changed the size of the dots or the sketch it would have taken down the quality several notches, which was a clear design aspect I wanted to maintain. It just felt very… elementary and not as delicate as henna is. 

So if I work through the issues with resizing then I think the vine issue is resolvable as well, but that goes back into fixing all of the frame count issues for the vine all over again. 

The other critique I got related to this idea that my project was not… “fun” enough, which I really don’t want it to turn into a Snapchat filter, or something as superficial as a photo like that. I really want to be focused on this idea of positive growth coming out of decay. I see this as a more serious piece. Then again I’m a really serious person. Maybe I’ll make the colors a little more fun, but I really still want the detail and the beauty… the delicacy almost to remain as I keep working on this project. 

One Reply to “MLNI Midterm (Research + Progress Towards Final) Healing Henna– Eszter Vigh”

Leave a Reply