|
1 | 1 | # Foundationpose-CPP |
2 | 2 | ## About this project |
3 | 3 |
|
4 | | -该项目基于[nvidia-issac-pose-estimation](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation)改写,去除了原项目中的复杂依赖,能够使用`FoundationPose`的Python工程[FoundationPose](https://github.com/NVlabs/FoundationPose)导出的onnx模型来做推理,部署应用十分方便。 |
| 4 | +This project is adapted from [nvidia-issac-pose-estimation](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation), with simplified dependencies. It enables inference using ONNX models exported from the [Python implementation](https://github.com/NVlabs/FoundationPose) of `FoundationPose`, making deployment and application highly convenient. |
5 | 5 |
|
6 | | -**Notes:** 该项目只包含了`FoundationPose`部分的代码,实际上6D位姿检测的运行,还依赖于目标物的掩码,需要运行类似`SAM`的算法,[EasyDeploy](https://github.com/zz990099/EasyDeploy)项目下提供了`MobileSAM`和`NanoSAM`的算法实现和推理优化,可供参考。 |
| 6 | +***Notes***: This repository only contains the code for the `FoundationPose` component. The complete 6D pose estimation pipeline also relies on object masks, which can be generated by algorithms like `SAM`. For reference implementations and optimized inference of `MobileSAM` and `NanoSAM`, please visit [EasyDeploy](https://github.com/zz990099/EasyDeploy). |
7 | 7 |
|
8 | 8 | ## Update LOG |
9 | 9 |
|
10 | | -- [2025.04] 解耦`Register`和`Track`过程; 令算法输出mesh下的位姿,提供mesh_loader相关的接口和方法供外部拓展。 |
11 | | -- [2025.03] 渲染过程与原Python工程对齐,支持无texture纹理输入渲染. [对应PR](https://github.com/zz990099/foundationpose_cpp/pull/13). |
12 | | -- [2025.03] 添加对Jetson Orin平台支持,[一键配置docker环境](docs/build_enviroment_on_jetson.md) |
| 10 | +**[2025.04]** Decoupled `Register` and `Track` processes; Output poses under mesh coordinates, providing `mesh_loader` interfaces for external extension. Related [PR](https://github.com/zz990099/foundationpose_cpp/pull/21). |
| 11 | + |
| 12 | +**[2025.03]** Aligned rendering process with the original Python implementation, supporting rendering without texture input. Related [PR](https://github.com/zz990099/foundationpose_cpp/pull/13). |
| 13 | + |
| 14 | +**[2025.03]** Added support for Jetson Orin platform with one-click Docker environment setup. See [link](docs/build_enviroment_on_jetson.md). |
13 | 15 |
|
14 | 16 | ## Features |
15 | 17 |
|
16 | | -1. 去除了原工程的复杂环境构建过程,以及各种依赖项问题,能够轻松适配到其他项目工程中。 |
17 | | -2. 对`FoundationPose`算法本身做了封装,**支持动态尺寸图像输入**,简单灵活。 |
18 | | -3. 提供了基于`BundleSDF`生成目标物三维模型的[脚本教程](./docs/gen_3d_obj_with_bundlesdf.md)。 |
19 | | -4. :fire: 支持Orin开发板(Orin-NX-16GB) |
| 18 | +1. Removed complex environment setup and dependency issues from the original project, enabling easy integration with other projects. |
| 19 | + |
| 20 | +2. Implemented encapsulation of the `FoundationPose` algorithm, supporting dynamic-sized image input for flexible usage. |
| 21 | +Provided [tutorial scripts](docs/gen_3d_obj_with_bundlesdf.md) for generating 3D object models using BundleSDF. |
| 22 | + |
| 23 | +3. :fire: Supports Jetson Orin development boards (Orin-NX-16GB). |
20 | 24 |
|
21 | 25 | ## Demo |
22 | 26 |
|
23 | | -运行公开数据`mustard`模型检测结果: |
| 27 | +Test results on public mustard dataset: |
24 | 28 |
|
25 | 29 | | <img src="./assets/test_foundationpose_register.png" alt="1" width="500"> | |
26 | 30 | |:----------------------------------------:| |
|
30 | 34 | |:----------------------------------------:| |
31 | 35 | | **foundationpose(fp16) Track test result** | |
32 | 36 |
|
33 | | -以下是在`nvidia-4060-8G`, `i5-12600kf`硬件上执行结果 |
| 37 | +**Performance on `nvidia-4060-8G` and `i5-12600kf`:** |
34 | 38 |
|
35 | 39 | | nvidia-4060-8G | fps | cpu | gpu | |
36 | 40 | |:---------:|:---------:|:----------------:|:----------------:| |
37 | 41 | | foundationpose(fp16)-Register | 2.8 | 100% | 6.5GB | |
38 | 42 | | foundationpose(fp16)-Track | 220 | 100% | 5.8GB | |
39 | 43 |
|
40 | | -以下是在`jetson-orin-nx-16GB`硬件上执行结果 |
| 44 | +**Performance on jetson-orin-nx-16GB:** |
41 | 45 |
|
42 | 46 | | jetson-orin-nx-16GB | fps | cpu | mem_total | |
43 | 47 | |:---------:|:---------:|:----------------:|:----------------:| |
44 | 48 | | foundationpose(fp16)-Register | 0.6 | 15% | 5.6GB(5.5GB on gpu) | |
45 | 49 | | foundationpose(fp16)-Track | 100 | 60% | 5.1GB(5.0GB on gpu) | |
46 | 50 |
|
47 | | - |
48 | 51 | ## Usage |
49 | | - |
50 | | -### Enviroment Build |
51 | | - |
52 | | -1. 下载`foundationpose_cpp`repo |
53 | | -```bash |
54 | | -git clone git@github.com:zz990099/foundationpose_cpp.git |
55 | | -cd foundationpose_cpp |
56 | | -git submodule init |
57 | | -git submodule update |
58 | | -``` |
59 | | - |
60 | | -2. 使用`docker`来构建运行环境 |
61 | | - ```bash |
| 52 | +### Environment Setup |
| 53 | + |
| 54 | +1. Clone the repository: |
| 55 | + ```bash |
| 56 | + git clone git@github.com:zz990099/foundationpose_cpp.git |
| 57 | + cd foundationpose_cpp |
| 58 | + git submodule init |
| 59 | + git submodule update |
| 60 | + ``` |
| 61 | + |
| 62 | +2. Build using Docker: |
| 63 | + ```bash |
62 | 64 | cd ${foundationpose_cpp} |
63 | 65 | bash easy_deploy_tool/docker/easy_deploy_startup.sh |
64 | | - # choose `jetson` -> `trt10_u2204`/`trt8_u2204` (`trt8_u2004` will not work) |
| 66 | + # Select `jetson` -> `trt10_u2204`/`trt8_u2204` (`trt8_u2004` not supported) |
65 | 67 | bash easy_deploy_tool/docker/into_docker.sh |
66 | | - ``` |
| 68 | + ``` |
67 | 69 |
|
68 | | -### Convert Models |
| 70 | +### Model Conversion |
69 | 71 |
|
70 | | -1. 从[google drive](https://drive.google.com/drive/folders/1AmBopDz-RrykSZVCroDH6jFc1-k8HkL0?usp=drive_link)中下载onnx模型文件,放到`/workspace/models/`文件夹下。 |
| 72 | +1. Download ONNX models from google drive and place them in `/workspace/models/`. |
71 | 73 |
|
72 | | -2. 运行模型转换脚本 |
73 | | - ```bash |
| 74 | +2. Convert models: |
| 75 | + ```bash |
74 | 76 | cd /workspace |
75 | 77 | bash tools/cvt_onnx2trt.bash |
76 | | - ``` |
| 78 | + ``` |
77 | 79 |
|
78 | | -### Compile Code |
| 80 | +### Build Project |
79 | 81 |
|
80 | | -1. 编译整个工程 |
81 | | - ```bash |
82 | | - cd /workspace |
83 | | - mkdir build && cd build |
84 | | - cmake -DENABLE_TENSORRT=ON .. |
85 | | - make -j |
86 | | - ``` |
| 82 | +1. Compile the project: |
| 83 | +```bash |
| 84 | + cd /workspace |
| 85 | + mkdir build && cd build |
| 86 | + cmake -DENABLE_TENSORRT=ON .. |
| 87 | + make -j |
| 88 | +``` |
87 | 89 |
|
88 | | -### Run demo |
| 90 | +### Run Demo |
89 | 91 |
|
90 | | -#### 运行公开数据集demo ---- mustard |
| 92 | +#### Use public Dataset Demo (mustard) |
91 | 93 |
|
92 | | -1. 下载数据集,放到`/workspace/test_data/`下,并解压,[下载地址](https://drive.google.com/drive/folders/1pRyFmxYXmAnpku7nGRioZaKrVJtIsroP) |
| 94 | +1. Download and extract the dataset to `/workspace/test_data/` from here. |
93 | 95 |
|
94 | | -2. 直接运行测试用例即可 |
95 | | - ```bash |
| 96 | +2. Run tests: |
| 97 | + ```bash |
96 | 98 | cd /workspace/build |
97 | 99 | ./bin/simple_tests --gtest_filter=foundationpose_test.test |
98 | | - ``` |
| 100 | + ``` |
99 | 101 |
|
100 | | -#### 自制三维模型 |
| 102 | +### Custom 3D Model Generation |
101 | 103 |
|
102 | | -1. 参考[利用BundleSDF生成三维模型](./docs/gen_3d_obj_with_bundlesdf.md) |
| 104 | +1. Refer to [Generating 3D Models with BundleSDF](./docs/gen_3d_obj_with_bundlesdf.md). |
103 | 105 |
|
104 | | -2. 根据您的自定义数据,修改`/workspace/simple_tests/src/test_foundationpose.cpp`下的路径,重新编译。 |
| 106 | +2. Modify paths in `/workspace/simple_tests/src/test_foundationpose.cpp` for your data and rebuild. |
105 | 107 |
|
106 | | -3. 运行测试用例 |
107 | | - ```bash |
| 108 | +3. Run tests: |
| 109 | + ```bash |
108 | 110 | cd /workspace/build |
109 | 111 | ./bin/simple_tests --gtest_filter=foundationpose_test.test |
110 | | - ``` |
| 112 | + ``` |
111 | 113 |
|
112 | | -在`/workspace/test_data/`下,可以看到`Register`和`Track`两个过程的结果。 |
| 114 | +4. Results for Register and Track processes will be saved in `/workspace/test_data/`. |
113 | 115 |
|
114 | 116 | ## References |
115 | 117 |
|
116 | | -- [nvidia-issac-pose-estimation](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation) |
| 118 | +- [nvidia-isaac-pose-estimation](https://github.com/NVIDIA-ISAAC-ROS/isaac_ros_pose_estimation) |
117 | 119 | - [FoundationPose](https://github.com/NVlabs/FoundationPose) |
118 | 120 | - [BundleSDF](https://github.com/NVlabs/BundleSDF) |
119 | 121 | - [XMem](https://github.com/hkchengrex/XMem) |
120 | 122 | - [EasyDeploy](https://github.com/zz990099/EasyDeploy) |
121 | 123 |
|
122 | | -有任何问题,欢迎联系`771647586@qq.com` |
| 124 | +For any questions, feel free to raise a issue or contact `771647586@qq.com`. |
0 commit comments