diff --git a/README.md b/README.md index 2224d55..9acccc8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ Fast triangulation of multiple persons from multiple camera views. ## Build -- Clone this project with submodules: +- Clone this project with submodules: + ```bash git clone --recurse-submodules https://gitlab.com/Percipiote/RapidPoseTriangulation.git cd RapidPoseTriangulation/ @@ -40,17 +41,19 @@ Fast triangulation of multiple persons from multiple camera views. - Restart docker: `sudo systemctl restart docker` - Build docker container: + ```bash docker build --progress=plain -t rapidposetriangulation . ./run_container.sh ``` - Build triangulator: + ```bash cd /RapidPoseTriangulation/swig/ && make all && cd ../tests/ && python3 test_interface.py && cd .. cd /RapidPoseTriangulation/scripts/ && \ - g++ -std=c++2a -fPIC -O3 -march=native -Wall -Werror -flto=auto -fopenmp -fopenmp-simd \ + g++ -std=c++2a -fPIC -O3 -march=native -Wall -Werror -flto=auto \ -I /RapidPoseTriangulation/rpt/ \ -isystem /usr/include/opencv4/ \ -isystem /onnxruntime/include/ \ @@ -72,11 +75,13 @@ Fast triangulation of multiple persons from multiple camera views. ``` - Test with samples: + ```bash python3 /RapidPoseTriangulation/scripts/test_triangulate.py ``` - Test with _skelda_ dataset: + ```bash export CUDA_VISIBLE_DEVICES=0 python3 /RapidPoseTriangulation/scripts/test_skelda_dataset.py diff --git a/extras/easypose/README.md b/extras/easypose/README.md index b9c769d..2c08ccd 100644 --- a/extras/easypose/README.md +++ b/extras/easypose/README.md @@ -1,6 +1,6 @@ # Test ONNX with EasyPose -Code files originally from: https://github.com/Dominic23331/EasyPose.git +Code files originally from:
diff --git a/extras/jetson/README.md b/extras/jetson/README.md index 9607e43..06e8e39 100644 --- a/extras/jetson/README.md +++ b/extras/jetson/README.md @@ -8,7 +8,7 @@ Tested with a _Jetson AGX Orin Developer Kit_ module. ## Base installation - Install newest software image: \ - (https://developer.nvidia.com/sdk-manager) + () - Use manual recovery mode setup for first installation @@ -19,7 +19,7 @@ Tested with a _Jetson AGX Orin Developer Kit_ module. ``` - Initialize system: \ - (https://developer.nvidia.com/embedded/learn/get-started-jetson-agx-orin-devkit) + () - Connect via _ssh_, because using _screen_ did not work, skip _oem-config_ step @@ -53,7 +53,7 @@ Tested with a _Jetson AGX Orin Developer Kit_ module. ``` - Enable _docker_ without _sudo_: \ - (https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user) + () - Enable GPU-access for docker building: @@ -97,7 +97,7 @@ Tested with a _Jetson AGX Orin Developer Kit_ module. cd /RapidPoseTriangulation/swig/ && make all && cd ../tests/ && python3 test_interface.py && cd .. cd /RapidPoseTriangulation/scripts/ && \ - g++ -std=c++2a -fPIC -O3 -march=native -Wall -Werror -flto=auto -fopenmp -fopenmp-simd \ + g++ -std=c++2a -fPIC -O3 -march=native -Wall -Werror -flto=auto \ -I /RapidPoseTriangulation/rpt/ \ -isystem /usr/include/opencv4/ \ -isystem /usr/local/include/onnxruntime/ \ diff --git a/extras/ros/rpt3d_wrapper_cpp/CMakeLists.txt b/extras/ros/rpt3d_wrapper_cpp/CMakeLists.txt index 303809a..df7d33d 100644 --- a/extras/ros/rpt3d_wrapper_cpp/CMakeLists.txt +++ b/extras/ros/rpt3d_wrapper_cpp/CMakeLists.txt @@ -6,9 +6,9 @@ if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 99) endif() -# Default to C++17 +# Default to C++20 if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17) + set(CMAKE_CXX_STANDARD 20) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -20,8 +20,6 @@ find_package(ament_cmake REQUIRED) find_package(rclcpp REQUIRED) find_package(rpt_msgs REQUIRED) find_package(std_msgs REQUIRED) -find_package(OpenCV REQUIRED) -find_package(OpenMP REQUIRED) # Add RapidPoseTriangulation implementation set(RAPID_POSE_TRIANGULATION_DIR "/RapidPoseTriangulation") @@ -33,14 +31,9 @@ ${RAPID_POSE_TRIANGULATION_DIR}/rpt/camera.cpp target_include_directories(rapid_pose_triangulation PUBLIC ${RAPID_POSE_TRIANGULATION_DIR}/extras/include ${RAPID_POSE_TRIANGULATION_DIR}/rpt - ${OpenCV_INCLUDE_DIRS} -) -target_link_libraries(rapid_pose_triangulation PUBLIC - ${OpenCV_LIBS} - OpenMP::OpenMP_CXX ) target_compile_options(rapid_pose_triangulation PUBLIC - -fPIC -O3 -march=native -Wall -Werror -fopenmp -fopenmp-simd + -fPIC -O3 -march=native -Wall -Werror ) # Build the executable @@ -51,7 +44,6 @@ target_include_directories(rpt3d_wrapper PUBLIC $) target_link_libraries(rpt3d_wrapper - ${OpenCV_LIBS} rapid_pose_triangulation ) diff --git a/media/RESULTS.md b/media/RESULTS.md index a2e5331..d7d92e7 100644 --- a/media/RESULTS.md +++ b/media/RESULTS.md @@ -2812,7 +2812,6 @@ Results of the model in various experiments on different datasets. \ ### Tsinghua -(duration 00:01:51) ```json { "img_loading": 0.111981, diff --git a/rpt/triangulator.cpp b/rpt/triangulator.cpp index 185698a..56581f1 100644 --- a/rpt/triangulator.cpp +++ b/rpt/triangulator.cpp @@ -1,8 +1,10 @@ +#include #include +#include +#include +#include #include - -#include -#include +#include #include "camera.hpp" #include "triangulator.hpp" @@ -10,45 +12,6 @@ // ================================================================================================= // ================================================================================================= -[[maybe_unused]] static void print_2d_mat(const cv::Mat &mat) -{ - // Ensure the matrix is 2D - if (mat.dims != 2) - { - std::cerr << "Error: The matrix is not 2D." << std::endl; - return; - } - - // Retrieve matrix dimensions - int rows = mat.rows; - int cols = mat.cols; - - // Print the matrix in a NumPy-like style - std::cout << "cv::Mat('shape': (" << rows << ", " << cols << ")"; - std::cout << ", 'data': [" << std::endl; - - for (int i = 0; i < rows; ++i) - { - std::cout << " ["; - for (int j = 0; j < cols; ++j) - { - std::cout << std::fixed << std::setprecision(3) << mat.at(i, j); - if (j < cols - 1) - { - std::cout << ", "; - } - } - std::cout << "]"; - if (i < rows - 1) - { - std::cout << "," << std::endl; - } - } - std::cout << "])" << std::endl; -} - -// ================================================================================================= - [[maybe_unused]] static void print_2d_poses(const std::vector> &poses) { std::cout << "Poses: (" << poses.size() << ", 3)[" << std::endl; diff --git a/rpt/triangulator.hpp b/rpt/triangulator.hpp index aba7dc4..88f6a53 100644 --- a/rpt/triangulator.hpp +++ b/rpt/triangulator.hpp @@ -1,12 +1,9 @@ #pragma once #include -#include #include #include -#include - #include "camera.hpp" // ================================================================================================= diff --git a/swig/Makefile b/swig/Makefile index bc4ab3a..77d3c46 100644 --- a/swig/Makefile +++ b/swig/Makefile @@ -1,5 +1,5 @@ # Standard compile options for the C++ executable -FLAGS = -fPIC -O3 -march=native -Wall -Werror -flto=auto -fopenmp -fopenmp-simd +FLAGS = -fPIC -O3 -march=native -Wall -Werror -flto=auto # The Python interface through SWIG PYTHON_VERSION = $(shell python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}");') @@ -8,7 +8,7 @@ PYTHONL = -Xlinker -export-dynamic # Default super-target all: - cd ../rpt/ && g++ $(FLAGS) -std=c++2a -isystem /usr/include/opencv4/ -c *.cpp ; cd ../swig/ + cd ../rpt/ && g++ $(FLAGS) -std=c++2a -c *.cpp ; cd ../swig/ swig -c++ -python -keyword -o rpt_wrap.cxx rpt.i g++ $(FLAGS) $(PYTHONI) -c rpt_wrap.cxx -o rpt_wrap.o - g++ $(FLAGS) $(PYTHONL) -shared ../rpt/*.o rpt_wrap.o -lopencv_core -lopencv_imgproc -lopencv_calib3d -o _rpt.so + g++ $(FLAGS) $(PYTHONL) -shared ../rpt/*.o rpt_wrap.o -o _rpt.so