AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
|
This is the AI Watch A1 docum entation for C++. AI Watch A1 uses one Intel RealSense D435 camera and OpenPose in order to achieve multi-person 3D skeleton detection. Once this task is completed, AI Watch A1 provides support to send each detected skeleton and its joint points' 3D coordinates (room and D435's details have to be specified) via Kafka, in order to let further detached computation possible.
Note: Instructions for MacOS with Intel CPU / M1 chip
1) Install RealSense SDK 2.0 and its own dependencies. The following guide is really helpful: build RealSense for macOS Monterey (Intel + Apple Silicon).
2) Install OpenPose and its own dependencies. Useful guides: build openpose with/without GPU support for macOS, OpenPose for M1/Intel.
In order to properly choose the GPU_MODE
during OpenPose installation and/or in order to install OpenPose on other operating systems, check out this page: OpenPose Docs. If you have MacOS with Intel CPU and a GPU that matches OpenPose prerequisites, then you can set GPU_MODE
to OPENCL
(GPU-accelerated, it is harder to install but provides a faster runtime speed). Otherwise, if you have a MacOS with M1 chip, it's suggested to set GPU_MODE
to CPU_ONLY
.
3) Install Apache Kafka, Confluent and their own dependencies. Confluent is not mandatory, but without it, you will have to set up the Kafka environment on your own. Useful guides:
how to install Apache Kafka on Mac, how to install Confluent.
4) Run the following command in your terminal:
After that, remove all the files named emptyFileForPadding.txt
in the cloned folder.
5) From /AI_Watch_A1/src/AI_Watch_A1/
folder, run the following commands in your terminal:
6) Copy OpenPose's models
folder to the project's build folder.
7) Copy OpenPose's BoostConfig.cmake
, FindGFlags.cmake
and FindGlog.cmake
files to the build/cmake/modules/
folder.
8) Update caffe lib
path inside CMakeLists.txt
. Then run the following commands in your terminal:
9) This step is optional. Run the following command in your terminal:
10) Now let's start the Kafka environment. Run the following commands in a new terminal session located on the parent folder of the confluent
folder. Set the environment variable for the Confluent Platform home directory:
Add the Confluent Platform bin directory to your PATH:
Test your installation by running the confluent command:
Your output should show the available commands for managing Confluent Platform.
Start Confluent Platform by using the Confluent CLI confluent local services start command. This command starts all of the Confluent Platform components, including Kafka, ZooKeeper, Schema Registry, HTTP REST Proxy for Kafka, Kafka Connect, ksqlDB, and Control Center.
Your output should resemble:
The confluent local commands are intended for a single-node development environment and are not suitable for a production environment. The data that are produced are transient and are intended to be temporary. For production-ready workflows, check Confluent website.
The Confluent CLI requires Java version 1.8 or 1.11. See Confluent versions interoperability.
In order to improve speed and general performance, you could disable images' showing and change the number of frames captured per second. In this last option, capturing too few frames per second reduces output' quality. Furthermore, it's also possible to reduce OpenPose's network resolution, but a significant drawback is reduced accuracy.
Place the camera in a way that it can "see" the left and the right wall of the room.
11) Navigate to http://localhost:9021
and create a new topic topic1
with default settings. Now go to /AI_Watch_A1/src/AI_Watch_A1/
and set up your Kafka parameters within the configuration_file.ini
file. At this point:
conf.conf
file and run the following command in your terminal:Note that the internal OpenPose execution is suggested.
1) The module can rarely get stuck on the following invocation located in RealSenseD435Manager::23
:
This means some errors have occurred, due to the USB connection while starting the camera's environment. In order to fix that, just exit the program, unplug the RealSense camera from the USB cable, and connect it again.
In order to contribute to AI Watch A1, please follow the contribution guidelines.
AI Watch A1 is licensed under the Apache License, Version 2.0. Copyright 2022. Please, see the license for further details and the /licenses
folder for the used libraries' licenses details.
a.a. 2021/2022