Message Boards Message Boards

Find Famous Faces: The Hour of Code in Barcelona

Last Friday I volunteered for an Hour of Code session at a high school class in Barcelona as part of my little contribution for Computer Science Education Week, December 7-13. My talk was aimed for a small group of students that had never programmed, and my goal was to introduce them to the Raspberry Pi and the Wolfram Language. The good thing is that at the end I succeeded to change the students' perception about programming. It changed from something that is over-complicated and boring to something that is accessible and even fun.

The lines of code that they enjoyed the most were these:

i=Import["http://statics.ccma.cat/multimedia/jpg/5/3/1433774407435.jpg"];
b=FindFaces[i,{Scaled[1/25],Scaled[1/7]}];
HighlightImage[i,Rectangle@@@b,Method->"Boundary"]

faces

faces = ImageTrim[i, #] & /@ b

faces

faces=Delete[faces,6];
celebs=Classify["NotablePerson",faces,{"TopProbabilities",5}];
pics=Partition[Thread[Rule[Keys@Flatten[celebs],Quiet[ImageTrim[#,First[FindFaces[#]]]]&/@EntityValue[Keys@Flatten[celebs],"Image"]]],5];
list={};
Table[list=Append[list,Part[Complement[i,list],2]],{i,Table[Select[i,ImageQ[#[[2]]]&],{i,pics}]}];
list

Famous Persons

ImageAssemble@Partition[ImageResize[#,100]&/@Riffle[list[[All,2]],faces],6]

Find Famous Faces collage

The fact that I was able to take a photo of them with my smart phone, send it to Data Drop, import it immediately to my slideshow, highlight their faces, get a direct answer to what famous persons they look like, and make a collage of their faces side by side with their famous counterparts, was a mind-blowing experience for them.

What others say about the Wolfram Language for the Hour of Code?

Go beyond the hour of code!

POSTED BY: Bernat Espigulé
3 Replies

Wait, are you kidding me? Is that a real high school class in Barcelona? It looks like a promotional picture for a TV show! Awesome project though, regardless of the natural star power of the subjects...

POSTED BY: Andre Kuzniarek

Super cool! Thanks for sharing Bernat!

POSTED BY: Adriana O'Brien

You are right, the subjects are local superstars in Barcelona :) http://www.imdb.com/title/tt4580372/

Here is the actual photo I took at the real school (Institut Méndez y Pelayo): class

And these are the famous people similar to the students:  Identified famous celeb

POSTED BY: Bernat Espigulé
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract