Close

Log 1: Linux and Windows Software Setup

A project log for Pose2Art: SmartCam to TouchDesigner, Unity via OSC

Create an AI Camera run on small 'edge' device that extract Pose and sends tracked points via OSC to TouchDesigner and Unity for ART!

jerry-isdaleJerry Isdale 11/27/2022 at 06:330 Comments

The first step after acquiring your hardware will be installing the basic software.   I dont have a Mac to test that side, so you Apple folks are on your own there.

Windows Rendering PC setup

Windows system basically needs just TouchDesigner installed. If you want to try the PC only pose-osc application (pose_PC_MediaPipe.py), you will need Python3 and some additional API. This application uses the PC's webcam to capture the pose data and send it via OSC.

$ pip3 install opencv-python mediapipe python-osc 

You may want to get a python development environment like PyCharm too. 

If you are going to run the python PC test tool pose_PC_MediaPipe.py, you will need to install the required dependencies.  I strongly recommend using Python3.  Note that TouchDesigner has its own Python installation separate from any system of venv you have on your PC.

Lastly, (fork and) download a copy of my GitHub code.

Linux Raspberry Pi Setup

Setting up Linux and all the software on the Raspberry Pi 4 can be simple or a long confusing process. Don't despair! There are simple steps below. 

The basic operating system on rPi is pretty easy - download the Raspberry Pi Imager on your development machine and use it to install the OS on an SD card. There are lots of tutorials on the web that will walk you through such setup using your Wifi Network to get updates, etc.  This tutorial from Qengineering can walk you through setup of the rPi OS (but read below first!!).    Qengineering has a number of quite informative blogs and other repositories. I heartily recommend checking them out.

After initial setup, you need to get all the various libraries (tensorFlow, openCV, liboscpp, etc) for your projects.  There are many versions of these and they have dependencies on various other libraries. Getting the right versions of the right libraries can be a very frustrating and time consuming process. Often you have to rebuild them from the source code - which may require other tools, and the right versions of those. Welcome to Dependency Hell.

HOWEVER - there is an easy way!  Qengineering has a built a Raspberry Pi 4 64-OS image with deep learning examples.  Download the image from that GitHub repository and use the Imager tool (link in previous paragraph) to copy it to your SD card.  Couple caveats: it is a 16GB image and if you use a larger SD card it will be wasted, also while this is a 64bit OS, it is Linux v10 Buster not the newer v11 Bullseye.  That is actually ok for us as v11 changed the whole Camera Driver subsystem (see link in first paragraph above for Qengineering info about that).  Most of the demos out there are built for v10. This will change over time. For now the v10 Buster image is fine for our prototype.  The image has a number of other tools and examples besides TensorFlow's Pose Estimation, so you can explore those. Check out Qengineering's github and blog posts for information on these.

During the initial rPi4 setup, it will be helpful to setup wifi access to your development network. You will also want to configure the rPi4 to access the Camera, SSH and Virtual Desktop. Most rPi setup tutorials will walk you through how to do these.

There are some rPi4 tune-up options that help with heat dissipation and some other aspects. This video runs thru them.  My machine was already up to date on them.

The only other dependency software we need on the linux side will be liboscpp - a c++ library for OSC.  The github repository for liboscpp has good instructions on how to install it.  I'd copy them here but if they update the library my instructions will be out of date.  Read down in those instructions for the RaspberryPi specific instructions.

Lastly, (fork and) download a copy of my GitHub code to your Pi.

Next Step: Networking Setup

Next you will need to setup the Networking between the rPi4 and your rendering system, which is different than the usual wifi setup.  I'll cover that in the next project log.

Discussions