This is the senior design project for the group of Xinyi Lai, Hao Hu, Zhi Cen and Kerui Zhu.
Python 3.x
Download the model and put it in the "pose_model_3d/models"
For simple setup, just use the following command:
pip install -r requirements.txt
and then you are ready to go. If you want to have a clear understanding of the use of the installed libraries, please read the following.
If you meet a problem with opencv-python, please uninstall the opencv-python and try the command in the Opencv-python section.
To run the 3D Pose Estimater, we need to install the PyTorch.
pip install torch
pip install torchvision
For a good user experience and a clear control flow, our project is wrapped up by a GUI application. The GUI method we use is pyqt5, since it supports the powerful QT5 and provides python bindings for higher design efficiency.
pip install pyqt5
pip install pyqt5-tools
pip install pyqtgraph
pip install pyOpenGL
To read the camera input, we use the opencv-python library, which is a python bindings for opencv.
pip install --no-binary opencv-python opencv-python
pip install opencv-contrib-python
pip install pexpect
pip install pygatt
pip install pandas
pip install matplotlib
Although Arduino IDE is capable for this project, its lack of auto-completion and syntax highlighting makes coding experience less enjoyable. To have a more pleasant coding experience, and more importantly, to write codes that are clearly structuralized and extensible to many devices (Arduino UNO, ESP32 board, ...), I decided to write the control code in c++ in vscode, with the help of extension PlatformIO.
Search "PlatformIO" in VSCode shop and click "install" to install it. The icon of the extension looks like this:
PlatformIO can support the framework for many different devices, like ESP32 board and Arduino UNO. It downloads libraries for different devices and manages the libraries seperately. The workspace of a PlatformIO project can be setup very easily with a platformio.ini file. The PlatformIO will automatically download the libraries needed according to the platformio.ini file.
Click the PlatformIO icon in the toolbar on the left and then click the "Open" under the "PIO Home" section. This will open the PlatformIO home page. Click "Open Project" and select the "arduino" directory in this project, which contains a platformio.ini file. The workspace should be setup in a minute if it is the first time you use it.
At the bottom of the VSCode, you can now see two buttons .
Click the left one to compile the code and click the right one to upload the code to the board.
To demo the project, type
python main.py