Some mixed cleanups.
This commit is contained in:
@ -16,6 +16,7 @@ Fast triangulation of multiple persons from multiple camera views.
|
||||
## Build
|
||||
|
||||
- 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Test ONNX with EasyPose
|
||||
|
||||
Code files originally from: https://github.com/Dominic23331/EasyPose.git
|
||||
Code files originally from: <https://github.com/Dominic23331/EasyPose.git>
|
||||
|
||||
<br>
|
||||
|
||||
|
||||
@ -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)
|
||||
(<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)
|
||||
(<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)
|
||||
(<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/ \
|
||||
|
||||
@ -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
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
|
||||
target_link_libraries(rpt3d_wrapper
|
||||
${OpenCV_LIBS}
|
||||
rapid_pose_triangulation
|
||||
)
|
||||
|
||||
|
||||
@ -2812,7 +2812,6 @@ Results of the model in various experiments on different datasets. \
|
||||
|
||||
### Tsinghua
|
||||
|
||||
(duration 00:01:51)
|
||||
```json
|
||||
{
|
||||
"img_loading": 0.111981,
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
#include <numeric>
|
||||
|
||||
#include <omp.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
#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<float>(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<std::array<float, 3>> &poses)
|
||||
{
|
||||
std::cout << "Poses: (" << poses.size() << ", 3)[" << std::endl;
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
|
||||
#include "camera.hpp"
|
||||
|
||||
// =================================================================================================
|
||||
|
||||
@ -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
|
||||
|
||||
Reference in New Issue
Block a user