Close

Alpha Code v0.1 - Pi Setup complete.

A project log for Narcissus

An interactive 3D printed sculpture that visualizes our collective interest in the #self.

diegoDiego 03/23/2018 at 14:560 Comments

After a lot of trial and error I finally have a working prototype of the Python code that will power the whole experience. It runs really well on OSX.

The basic pseudo-code:

Twitter Authentication (REST API)
Get all tweets with "#selfie"
For every tweet:
  Parse JSON for IMG file.
  IF image is present
    Find faces in image
    Crop random face
    Display face in OLED display
  ELSE
    break 

It works! 🔥🔥🔥🔥

All of this will be executed on a Raspberry Pi. Initially I was using a Pi Zero W, but the face recognition part was taking too long and since space isn't really an issue I could benefit from a little extra computing power; so upgraded to a Pi 3 B+. Now I need to optimize and cut down time to process the image and find the face. Multi-threading might be the answer.

The trickiest part so far has been the initial setup of all the required libraries, took me about 9 tries (about 15h each) on the Pi Zero only to realize it was too slow. The Pi 3 B+ was easier to set up, and I'll be writing a quick summary of everything I learned in the hopes others will find it useful. A Raspberry Pi quick setup guide for noobs like me.

I will be traveling over the next week, planning to use plane time to write and down time to code. Stay tuned for new updates.

Hardware:

The libraries I'm using thus far:

Next steps

  1. Optimize code to be multi-threaded
    1. Separate Twitter, File handling, OLED, and Facial recognition into individual threads.
  2. Begin 3D scanning experiments to get the right 3D model.
  3. 3D printing tests, material explorations, and sizing. 

Discussions