How Can a Spacecraft Use AI?

This is a computer translation of the original content. It is provided for general information only and should not be relied upon as complete or accurate.

Sorry, we can't translate this content right now, please try again later.

Pose Detection (Part 3 of 3)

In our previous post, we implemented the HoG method to detect people in frames. HoG works fine when people are upright, however it does not detect people well in clusters or in unusual positions. In this tutorial, you will learn how to implement a deep neural network designed to estimate the posture of multiple people in an image using the Intel® AI DevCloud.

HoG and SVM are a pretty powerful combination, but we can improve our detection with a pretrained neural network. We will use an open source pose estimator developed by researchers at Carnegie Mellon University and implemented for TensorFlow* and CPU by Ildoo Kim. This software enables real-time pose estimation on CPU devices thanks to Kim's selection of MobileNet, a neural network designed for edge and mobile computing. Read more about the original implementation on GitHub.

AI DevCloud for Post Estimation
For this tutorial, we will use the Intel AI DevCloud, but feel free to use any cloud service like AWS or Google Cloud for the challenge. The Intel AI DevCloud allows us to generate data much faster than with only a personal computer.

The first cell uses the magic command "%%writefile" to save the cell contents as "pose_job.txt". Important: Remember to add a trailing newline to the cell or else the job won't run.

We can call system commands in the Jupyter* Notebook by preceding a line with an exclamation mark. `!ls` for example calls the `ls` system command. And we can return the output to a variable. This allows us to check the status of the job submitted with `qsub`.

Since we want to be notified when the job is finished (a fraction of a second per image), we can use a helper function `wait_for`:

Calling `wait_for(job_id)` prints a period every 2 seconds until the job is finished:

We can then examine the output of our job (stderr, followed by stdout) and see that an image was saved at `output/test.png`:

We can plot the contents of `output` with `plot_dir` and see our image:

To estimate the poses for several images in a directory, replace the python src/run.py command in pose_job.txt with python src/run_directory.py --folder=<folder>.

Note: Algorithms like deep neural networks can be optimized for many CPUs, FPGAs, IPUs, and VPUs (ie, Intel® Movidius™ Neural Compute Stick) on a variety of platforms by using the new Intel® OpenVINO™ toolkit.

Challenges

Cue lights or music in real-time with hand position (Basic)

Cue lights or music in real-time with gestures (Intermediate)

Analyze body posture over time to suggest exercise (Advanced)

​Further Challenges

Control music in the room by calculating optical flow

Optimize the real-time posture detection models to run on the Intel® Movidius™ Neural Compute Stick or with an Up Squared* board

Track the number of people in each frame of a webcam capture and use it to activate LED lights

Master student and research assistant, University of Osnabrueck, Germany

Justin is an AI Master Thesis worker at Peltarion researching deep learning model introspection. He develops AI software as an Intel Software Innovator and demos his projects at Intel’s booths at NIPS, ICML, and CVPR.. He previously worked as a neuroscientist in the US.