FoundationPose-TensorRT

计算机科学 概化理论 变压器 人工智能 边距(机器学习) 姿势 统一模型 机器学习 计算机视觉 模式识别(心理学) 统计 物理 数学 量子力学 电压 气象学
作者
Bowen Wen,Wei Yang,Jan Kautz,Stan Birchfield
出处
期刊:Cornell University - arXiv [Cornell University]
被引量:9
标识
DOI:10.48550/arxiv.2312.08344
摘要

TensorRT-accelerated 6DoF object pose estimation and tracking based on FoundationPose. Given an RGB-D image, a 3D mesh of the object, and an initial segmentation mask, the model estimates the object pose and tracks it across subsequent frames. Credits The core inference code is derived from tao-toolkit-triton-apps, with the heavy Triton Inference Server dependencies removed and replaced by a direct TensorRT backend. The ONNX models are provided by isaac_ros_foundationpose. Setup 1. CUDA and TensorRT dependencies Install CUDA 12.4 + cuDNN 9.8 and TensorRT 10.9.0 into a local `deps/` folder: source scripts/deps.shactivate_deps This downloads and installs the dependencies locally - no system-wide installation required. The environment variables (`CUDA_HOME`, `TENSORRT_HOME`, `PATH`, `LD_LIBRARY_PATH`) are only active in the current shell session. Run `deactivate_deps` to restore the original environment. To use a different CUDA or TensorRT version, edit `scripts/deps.sh`. Make sure the PyTorch CUDA version matches (see step 2). 2. Python environment Create and activate a Python environment, e.g. with conda: conda create --name fp_tensorrt python=3.10conda activate fp_tensorrt Then install all Python dependencies (requires `activate_deps` to be active): source scripts/deps.sh && activate_depsbash scripts/setup.sh This installs PyTorch 2.5.0 (CUDA 12.4), nvdiffrast, pytorch3d, TensorRT Python bindings, and other required packages. 3. Model compilation Download the ONNX models from NVIDIA NGC and compile them into TensorRT engine files: bash scripts/convert_onnx.sh This produces weights/tensorrt/refiner_cs252.plan and weights/tensorrt/scorer_cs252.plan. chunk_size variable inside convert_onnx.sh controls the maximum batch size of the TensorRT engines (default: 252). A smaller value reduces VRAM usage, which is useful when tracking multiple objects simultaneously or on memory-constrained GPUs. To change it, edit the chunk_size variable before running and use the matching value in FoundationPoseWrapperConfig. Usage Demo Run the benchmark on the YCB mustard bottle sequence (demo data is downloaded automatically): source scripts/deps.sh && activate_depspython demo.py This runs initial pose estimation on the first frame and tracks the object across the remaining frames, printing per-frame poses and mean inference times. Python API from foundationpose_tensorrt import FoundationPoseWrapper, FoundationPoseWrapperConfig cfg = FoundationPoseWrapperConfig( downsample_width=None, # Set e.g. to 256 for faster inference at lower accuracy est_refine_iter=5, # Refinement iterations for initial pose estimation track_refine_iter=2, # Refinement iterations for tracking chunk_size=252, # Must match the `chunk_size` of the compiled TensorRT engine)wrapper = FoundationPoseWrapper(cfg=cfg) # Set camera intrinsics (3x3 numpy array)wrapper.set_camera_intrinsics(K) # Load object meshmesh = FoundationPoseWrapper.load_mesh("path/to/mesh.obj") # --- First frame ---wrapper.reset_scene(color, depth) # color: (H,W,3) uint8, depth: (H,W) float32 in meterspose = wrapper.add_object("object_name", mesh, mask) # mask: (H,W) bool # --- Subsequent frames ---poses = wrapper.step_scene(color, depth) # returns dict[name -> (4,4) numpy array] # Visualizevis = wrapper.render_results() # returns BGR image with projected bounding box and axes Poses are returned as 4x4 homogeneous transformation matrices (object-in-camera frame). Project structure scripts/ deps.sh # Install/activate CUDA, cuDNN, TensorRT locally setup.sh # Install Python dependencies convert_onnx.sh # Download ONNX models and compile to TensorRTsrc/foundationpose_tensorrt/ wrapper.py # High-level FoundationPoseWrapper API model.py # TensorRT engine wrapper and FoundationposeModel postprocessor.py # Rendering, cropping, and pose utilitiesweights/ onnx/ # Downloaded ONNX models tensorrt/ # Compiled TensorRT .plan filesdemo.py # Benchmark on YCB mustard data
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
刚刚
赵赶超应助plucky采纳,获得200
刚刚
1秒前
大模型应助博纳清采纳,获得10
2秒前
懵懂的海露完成签到,获得积分10
3秒前
精明鸵鸟发布了新的文献求助10
3秒前
顾矜应助求文采纳,获得10
4秒前
妙姝发布了新的文献求助10
5秒前
7秒前
7秒前
科研通AI6.2应助Pluto采纳,获得10
8秒前
8秒前
勤劳的斑马完成签到,获得积分10
8秒前
8秒前
yy16完成签到,获得积分10
8秒前
tayyy完成签到 ,获得积分10
8秒前
wz完成签到,获得积分10
9秒前
cmaz完成签到 ,获得积分10
10秒前
星辰大海应助Rabbit采纳,获得10
11秒前
sociate发布了新的文献求助10
11秒前
ll发布了新的文献求助10
12秒前
江楼月完成签到 ,获得积分10
14秒前
文艺稚晴发布了新的文献求助10
14秒前
yoqalux发布了新的文献求助10
15秒前
17秒前
科研通AI6.4应助芮rich采纳,获得10
17秒前
求文完成签到,获得积分20
18秒前
Hello应助小胡采纳,获得10
18秒前
18秒前
18秒前
21秒前
求文发布了新的文献求助10
22秒前
文静紫烟发布了新的文献求助10
22秒前
王q完成签到,获得积分10
23秒前
CQ完成签到,获得积分10
23秒前
23秒前
AAA完成签到,获得积分10
23秒前
24秒前
道阻且长发布了新的文献求助10
25秒前
25秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
内視鏡的に摘除しえた十二指腸乳頭部腫瘍の2例 660
Cognitive Psychology in a Changing World 600
On nonlinear stability of contact discontinuities. In: Hyperbolic problems: theory, numerics, applications (Stony Brook, NY, 1994) 510
Management and the Arts 510
Matrix Methods in Data Mining and Pattern Recognition Second Edition 510
微电子器件实验教程 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7680766
求助须知:如何正确求助?哪些是违规求助? 9245101
关于积分的说明 19933020
捐赠科研通 7251281
什么是DOI,文献DOI怎么找? 3287748
关于科研通互助平台的介绍 2445368
邀请新用户注册赠送积分活动 2291162