Art is often made to appeal to a specific set of viewers. This is the 9th blog in a series exploring the idea of using AI to recognize a viewer and adapt art to their age or interest. The intent is to encourage early art appreciation while being attractive to all household members.
In previous posts the near completion of the build has been presented and image recognition capabilities demonstrated. Art, in the form of short animations involving drawings by the children, was shown. In this post the software that will control the art after image recognition occurs is described and demonstrated.
Pi Presents
Due to a lack of knowledge and experience with Linux and Python the software development for displaying and controlling art was progressing slowly. The requirements are:
- Easy to run on a Raspberry Pi
- Able to manage multimedia - e.g. video, stills, sound, etc.
- Able to read and output GPIO
So I did a search for existing software and found Pi Presents, "a toolkit for producing interactive multimedia applications for museums, visitor centres, and more". It is Python based. The video player uses omxplayer with all supported formats, and the image player supports all formats in the Python Imaging Library. It also includes a message player and audio player. Numerous working examples that demonstrate the capabilities are included.
Installation on a Raspberry Pi is straight forward and the code and instructions are on github.
Using the Toolkit
Development with Pi Presents is done in a web based editor - knowledge of Python is not required. Some files such as setting up GPIO are done in a text editor. File arrangement is quirky and was non-intuitive to me but manageable. I found documentation complete, but hard to follow in places. The examples are a good place to start and served as jumping off places for modification. What follows is not a tutorial - I don't consider myself sufficiently knowledgeable and a good tutorial covering all the capabilities would require a lot of effort.
Developing on the project hardware has become difficult since the enclosure was completed since pins, the SD card, and such are now difficult to access. Accordingly Pi Presents development was done on a separate Raspberry Pi as seen just behind the keyboard and in front of the project enclosure in the photo below.
A breadboard and jumpers were used to simulate input from the Pi running the face recognition software and display was done on the large monitor in the background. The most difficult part of setting up the software was understanding and setting up GPIO pins. The screenshot below shows the web based editor after opening and selecting the presentation (in this case my PiCasso presentation, already working).
The window on the right side of the editor contains the "tracks" that will be played. They are stored in a media directory and selected easily using the web based editor. To enable playing them it is necessary to edit the controls in the "show" which is located in the upper left corner. The control edit panel when opened is shown below.
Also shown on the left of the screen shot is a file that contains pin configuration which must be done in a text editor and placed in a named folder in the correct location.
Pi Presents is powerful and I recommend it with the proviso that it is not a refined product like for example PowerPoint. Expect to spend some time reading the manual and studying examples while figuring out the quirks as you learn to use it.
Demonstration
The video below demonstrates Pi Presents working with the art currently contributed by my grandchildren. The other adults in the family have feigned interest in the project, but not much interest in contributing art. So it might just be me and the kids, with me being the biggest kid. The 404 message above is displayed when an unrecognized face, or one of the non-participating adults is recognized.
Upcoming Work
This weeks work was a milestone as all the pieces work and have been demonstrated now. What remains is integration and refinement. Upcoming work will include:
- Integration and refinement
- Additional art
- Demonstration video and final documentation
Thanks for reading - comments and suggestions are always welcome.
Other Blogs in this Series
PiCasso Adapting Art to Viewers: Introduction Blog #1
PiCasso Adapting Art to Viewers: OpenCV Face Detection, Blog #2
PiCasso Adapting Art to Viewers: Cabinet Design, Blog #3
PiCasso Adapting Art to Viewers: Pi talks to Pi, Blog #4
PiCasso Adapting Art to Viewers: Grandpa Shark, Blog #5
PiCasso Adapting Art to Viewers: More on Cabinet Design, Blog #6
PiCasso Adapting Art to Viewers: New Art, Blog #7
PiCasso Adapting Art to Viewers: Mechanical Complete, Blog #8
Top Comments