Skip to content

Add depth_to_point_cloud operator and demo - #1588

Open
snknitheesh wants to merge 17 commits into
nvidia-holoscan:mainfrom
snknitheesh:zozo/ops_point_cloud_from_depth
Open

snknitheesh wants to merge 17 commits into
nvidia-holoscan:mainfrom
snknitheesh:zozo/ops_point_cloud_from_depth

Conversation

@snknitheesh

@snknitheesh snknitheesh commented May 30, 2026

Copy link
Copy Markdown

Summary

Adds depth_to_point_cloud, a GPU operator that deprojects an organized depth image into an organized point cloud, plus a hardware-free demo application.

It turns a depth image (from a depth camera, stereo matcher, or monocular depth network) plus pinhole intrinsics into per-pixel XYZ points in the camera optical frame — all GPU-resident, zero-copy on the hot path, via a single custom CUDA kernel (one thread per pixel). It supports uint16 and float32 depth, an optional per-frame intrinsics override, and optional XYZRGB colored output. It is sensor-agnostic — no dependency on any specific camera SDK.

What's included

  • operators/depth_to_point_cloud/ — C++/CUDA operator (DepthToPointCloudOp) with pybind11 Python bindings
  • A standalone CUDA golden-reference unit test (test/test_deproject.cu, registered with CTest) and a pytest binding test (test_depth_to_point_cloud.py)
  • applications/depth_to_point_cloud_demo/ — a synthetic, hardware-free demo (CI-friendly)

Ports

Port Direction Type
depth in depth tensor, uint16 or float32, [H, W] / [H, W, 1], device
intrinsics in (optional) float32[4] [fx, fy, cx, cy] (per-frame override)
color in (optional) uint8 [H, W, 3] or [H, W, 4] aligned to depth
point_cloud out float32 [H, W, 3] (+ colors uint8 [H, W, 3] when color is connected)

Testing

  • CUDA golden unit test passes (float32 + uint16 paths, depth clipping → NaN, color passthrough)
  • pytest binding test passes (construction, port wiring, error handling, parameters)
  • Synthetic demo runs and validates per-frame point counts
  • Full ./holohub lint gate passes (black, isort, ruff, cpplint, markdownlint, metadata schema, cmakelint, codespell, copyright)

Checklist

  • Follows HoloHub naming conventions and coding standards
  • ./holohub lint passes
  • New tests pass (CUDA golden + pytest + demo CTest)
  • README.md and metadata.json provided for both operator and demo
  • Registered via add_holohub_operator / add_holohub_application
  • All commits signed off (DCO)
  • Holoscan SDK >= 4.0.0 (tested on 4.3.0); platforms x86_64 and aarch64

Summary by CodeRabbit

  • New Features

    • Depth-to-point-cloud GPU operator with optional color passthrough and Python bindings
    • New demo app that synthesizes depth, deprojects to organized point clouds, and reports per-frame stats
  • Documentation

    • Comprehensive READMEs and metadata for the operator and demo with usage, intrinsics guidance, and visualization notes
  • Tests

    • CUDA golden test, Python unit tests, and CI test integration
  • Chores

    • Build and packaging integration for operator and demo targets

Signed-off-by: Nitheesh Kumar <snknitheesh@gmail.com>
Signed-off-by: Nitheesh Kumar <snknitheesh@gmail.com>
Copilot AI review requested due to automatic review settings May 30, 2026 18:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new DepthToPointCloudOp Holoscan operator that performs GPU-side deprojection of an organized depth image into an organized point cloud, with optional per-frame intrinsics and color passthrough. Includes Python bindings, a standalone CUDA golden-reference test, Python pybind tests, and a hardware-free synthetic demo application.

Changes:

  • New depth_to_point_cloud operator (C++/CUDA core, pybind11 bindings, headers, CMake, metadata).
  • New standalone CUDA kernel test plus a Python binding test suite.
  • New depth_to_point_cloud_demo Python application (synthetic generator → operator → stats sink) wired into the top-level CMake.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
operators/depth_to_point_cloud/deproject.{hpp,cu} CUDA kernel + launcher for depth deprojection.
operators/depth_to_point_cloud/depth_to_point_cloud.{hpp,cpp} Holoscan operator wrapping the kernel, with optional intrinsics/color inputs.
operators/depth_to_point_cloud/python/{CMakeLists.txt,depth_to_point_cloud.cpp} pybind11 bindings exposing the op to Python.
operators/depth_to_point_cloud/test/{CMakeLists.txt,test_deproject.cu} Standalone nvcc-only golden-reference kernel test registered with CTest.
operators/depth_to_point_cloud/test_depth_to_point_cloud.py Pytest checks for construction, ports, required args, and parameter acceptance.
operators/depth_to_point_cloud/{CMakeLists.txt,metadata.json,README.md} Build, metadata, and documentation for the operator.
operators/CMakeLists.txt Registers the new operator subdirectory.
applications/depth_to_point_cloud_demo/* Synthetic Python demo, README, metadata, and CTest hook.
applications/CMakeLists.txt Registers the demo application with operator dependency.

Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp Outdated
Comment thread applications/depth_to_point_cloud_demo/CMakeLists.txt Outdated
Comment thread operators/depth_to_point_cloud/test/test_deproject.cu Outdated
Comment thread operators/depth_to_point_cloud/deproject.cu Outdated
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp Outdated
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
@greptile-apps

greptile-apps Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces DepthToPointCloudOp, a GPU operator that deprojects an organized depth image (uint16 or float32) into a per-pixel H×W×3 point cloud using a single grid-stride CUDA kernel, plus a hardware-free synthetic demo application. CUDA stream ordering for the optional intrinsics and color ports is handled via receive_cuda_stream on each port, which addresses the stream-synchronization concerns raised in prior review rounds.

  • Operator (operators/depth_to_point_cloud/): shape and dtype validation, fx/fy zero-division guard, correct pinhole deprojection math, optional RGBA→RGB color passthrough, and allocator-backed output tensors.
  • Tests: a standalone nvcc-only golden-reference test (all four cases now capture and check the launch_deproject return value), pybind11 binding tests, and a CTest-registered demo run.
  • Demo (applications/depth_to_point_cloud_demo/): SyntheticDepthGeneratorOp generates a tilted-plane depth + RGB image entirely on-GPU; PointCloudStatsOp validates per-frame point counts for CI; --visualize routes the cloud through HolovizOp.

Confidence Score: 5/5

  • Safe to merge. The operator's CUDA stream handling, shape/dtype validation, and allocation checks are all correct; previous stream-ordering concerns have been addressed.
  • The core deprojection kernel, operator compute path, and test suite are well-constructed. CUDA stream synchronization across the three input ports is explicitly handled. All four golden-reference test cases capture and verify the kernel launch return value. The only notable gap is that PointCloudStatsOp in the demo unconditionally reads msg["colors"], which would crash if the sink were reused without the color port connected — but this does not affect the current demo or the operator itself.
  • No files require special attention. The demo's PointCloudStatsOp has a minor assumption documented inline that future adapters should note.

Important Files Changed

Filename Overview
operators/depth_to_point_cloud/deproject.cu Core CUDA kernel and launch wrapper. Validity logic, grid-stride loop, and uchar3/uchar4 color dispatch are correct. cudaPeekAtLastError() return pattern is acceptable given prior CUDA_TRY guards clear the error state before launch.
operators/depth_to_point_cloud/depth_to_point_cloud.cpp Operator compute path: stream acquisition via receive_cuda_stream on all three input ports correctly orders producers, shape validation rejects 2D color and [H,W,3] depth, fx/fy zero-division guard fires before the kernel, and output allocation is checked at each step.
operators/depth_to_point_cloud/test/test_deproject.cu Four-case golden-reference test covering float32 full-frame match, uint16 scale, depth_max clipping, and uchar3 color passthrough. All cases now capture and CHECK the launch_deproject return value — previously flagged issues are resolved.
applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py Demo application wiring is correct. PointCloudStatsOp unconditionally accesses msg["colors"], which will crash if the sink is reused without the color port connected — see inline comment.
operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp pybind11 trampoline mirrors all C++ parameters with correct defaults. Keyword-argument names match the C++ spec params exactly.
operators/depth_to_point_cloud/CMakeLists.txt Build target correctly links holoscan::core, sets CUDA_ARCHITECTURES to native, and gates the Python and test subdirectories on the right CMake options.

Sequence Diagram

sequenceDiagram
    participant Gen as SyntheticDepthGeneratorOp
    participant Op as DepthToPointCloudOp
    participant Kernel as deproject_kernel (CUDA)
    participant Sink as PointCloudStatsOp

    Gen->>Op: depth [H,W] float32 (stream A)
    Gen->>Op: color [H,W,3] uint8 (stream A)

    Op->>Op: receive_cuda_stream("depth") → stream
    Op->>Op: receive_cuda_stream("color") → sync color stream onto stream
    Note over Op: validate shape, dtype, dimensions
    Note over Op: validate fx/fy > 0

    Op->>Op: allocate float32 [H,W,3] XYZ output
    Op->>Op: allocate uint8  [H,W,3] colors output

    Op->>Kernel: launch_deproject(depth, color, stream)
    Note over Kernel: one thread per pixel (grid-stride)<br/>Z = raw * depth_scale<br/>valid = z>0 ∧ finite ∧ [depth_min,depth_max]<br/>X=(u−cx)·Z/fx  Y=(v−cy)·Z/fy<br/>invalid→(NaN,NaN,NaN)

    Kernel-->>Op: float32 [H,W,3] XYZ + uint8 [H,W,3] colors

    Op->>Sink: "point_cloud entity {point_cloud, colors}"
    Sink->>Sink: report valid count and Z range
Loading

Reviews (16): Last reviewed commit: "Merge branch 'main' into zozo/ops_point_..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a CUDA deprojection kernel and launch API, a Holoscan C++ operator with CUDA-backed compute and Python bindings, CUDA golden and PyTest unit tests, CMake registration and build wiring, operator/demo README and metadata, and a synthetic GPU demo application with CLI and test registration.

Changes

Depth to Point Cloud Operator and Demo

Layer / File(s) Summary
CUDA deprojection kernel & header
operators/depth_to_point_cloud/deproject.hpp, operators/depth_to_point_cloud/deproject.cu
Dependency-free header plus templated CUDA kernel and launch helper that convert organized HxW depth to HxW float3 XYZ, apply depth_scale and min/max validity checks, emit invalid_value for invalid pixels, and optionally passthrough color from uchar3/uchar4 inputs.
Holoscan operator C++ implementation, CMake, docs, metadata
operators/depth_to_point_cloud/depth_to_point_cloud.hpp, operators/depth_to_point_cloud/depth_to_point_cloud.cpp, operators/depth_to_point_cloud/CMakeLists.txt, operators/depth_to_point_cloud/README.md, operators/depth_to_point_cloud/metadata.json, operators/CMakeLists.txt
DepthToPointCloudOp Operator class with setup()/compute() that validate depth/color tensors, read per-frame intrinsics (optional), allocate device outputs, launch the CUDA kernel on a chosen CUDA stream, and emit point_cloud. CMake registers the shared target and conditional Python/test subdirs; docs and metadata describe usage and requirements.
Python bindings and build configuration
operators/depth_to_point_cloud/python/CMakeLists.txt, operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp
PyBind11 module _depth_to_point_cloud exposes DepthToPointCloudOp with a Python-friendly constructor that maps kwargs into the C++ operator ArgList and binds setup(spec).
Tests: CUDA golden tests and Python unit tests
operators/depth_to_point_cloud/test/CMakeLists.txt, operators/depth_to_point_cloud/test/test_deproject.cu, operators/depth_to_point_cloud/test_depth_to_point_cloud.py
CUDA golden-reference test validates kernel correctness across float/uint16, bounds handling, and color passthrough; CTest wiring included. PyTest verifies Python binding construction, BaseOperator compatibility, port/spec wiring, required allocator validation, and parameter acceptance.
Demo application, CMake integration, README, metadata
applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py, applications/depth_to_point_cloud_demo/CMakeLists.txt, applications/depth_to_point_cloud_demo/README.md, applications/depth_to_point_cloud_demo/metadata.json, applications/CMakeLists.txt
Python demo composes a GPU-only synthetic depth/RGB generator (SyntheticDepthGeneratorOp), DepthToPointCloudOp using device memory/stream pools, and a PointCloudStatsOp sink that counts non-NaN Z values and reports Z min/max. Includes CLI flags (--frames, --width, --height), demo CMake test registration, README with usage and RealSense guidance, and metadata manifest.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • nvidia-holoscan/holohub#1554: Changes to pybind11 Holohub module install/RPATH behavior that may affect building Python bindings for this operator.

Suggested reviewers

  • bhashemian
  • jjomier
  • cdinea
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main changes: adding a depth_to_point_cloud operator and a demo application, which aligns with the substantial changeset across operators/ and applications/ directories.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py`:
- Around line 137-138: The focal-length fy is incorrectly computed from
self._width causing vertical scaling; update the assignment for fy in
depth_to_point_cloud_demo.py to derive from image height (use
float(self._height) * 0.8) while keeping fx as float(self._width) * 0.8 so fx
and fy reflect width and height respectively; modify the line that sets fy
(currently using self._width) to use self._height instead and ensure types
remain float.
- Around line 154-162: In main(), validate CLI values before constructing
DepthToPointCloudDemoApp: check args.frames, args.width, and args.height are
positive integers (>0) and if not call parser.error(...) (or raise SystemExit
with a clear message) referencing the offending argument; perform these checks
immediately after args = parser.parse_args() and only build app =
DepthToPointCloudDemoApp(...) when all values pass validation so array
allocation/scheduling errors are avoided.

In `@applications/depth_to_point_cloud_demo/metadata.json`:
- Around line 27-28: The first tag in the metadata.json "tags" array is an
unapproved top-level category ("Point Cloud"); update the tags array so the
first element is one of the approved top-level categories (e.g., "Robotics",
"Computer Vision", "3D", etc.) and move "Point Cloud" to a subsequent position
(e.g., ["Robotics", "Point Cloud", "Depth", "3D"]); ensure the "tags" array
order now has a valid approved category as the first entry so the category rule
is satisfied.
- Around line 37-39: The run.command in metadata.json incorrectly uses the
<holohub_app_source> placeholder; update run.command to point to the built app
path relative to the declared workdir ("holohub_bin") instead of a source
placeholder. Locate the "run" object and replace "python3
<holohub_app_source>/depth_to_point_cloud_demo.py" with a command that invokes
the script from the build-workspace layout under holohub_bin (e.g., the relative
path to the built depth_to_point_cloud_demo.py), ensuring the path matches the
build output location used by the project.

In `@operators/depth_to_point_cloud/deproject.cu`:
- Around line 75-86: The switch over dtype (DepthDType) in the deprojection
launch code does not handle unexpected enum values, so add an explicit default
branch in the switch that catches invalid DepthDType values (when dtype is not
kUint16 or kFloat32) and returns a non-success CUDA error (e.g., return
cudaErrorInvalidValue) or logs and throws as appropriate; update the function
surrounding the deproject_kernel launches to propagate that error instead of
falling through to a cudaSuccess return.
- Around line 67-73: Validate color_channels before casting the input color
pointer: instead of treating any non-4 value as 3, explicitly check for
color_channels == 4 and color_channels == 3 when assigning color4 or color3, and
handle other values as an error path (e.g., skip color processing, set out_color
to default, or return/log an error). Update the block that inspects color,
out_color, color_channels and assigns color4/color3 to only perform static_cast
when the channel count matches, and add a fallback branch for invalid channel
counts to avoid misinterpreting layout and corrupt reads.

In `@operators/depth_to_point_cloud/depth_to_point_cloud.cpp`:
- Around line 120-124: The current code accepts any depth tensor rank >=2 and
ignores extra trailing dimensions; change the rank check in the
DepthToPointCloudOp routine to only allow shape.size() == 2 or shape.size() == 3
and, if 3, require shape[2] == 1; otherwise throw a std::runtime_error
indicating unsupported depth tensor shape. Use the same shape vector to compute
height and width (height = static_cast<int>(shape[0]); width =
static_cast<int>(shape[1])) after the validation so higher-rank tensors like
[H,W,3] are rejected rather than silently processed.
- Around line 127-142: The code can proceed with fx_/fy_ == 0.0 when no
"intrinsics" input is provided, causing divide-by-zero in the deprojection
kernel; after constructing CameraIntrinsics intr (the
CameraIntrinsics{fx_.get(), fy_.get(), cx_.get(), cy_.get()} and after the
override from op_input.receive), add a sanity check that intr.fx and intr.fy are
non-zero (or abs(value) > small epsilon, e.g. 1e-6) and throw a
std::runtime_error (similar style to existing errors) if they are invalid; place
this check in depth_to_point_cloud.cpp before any CUDA memcpy/stream work or
before the kernel launch so the operator fails fast with a clear message
referencing fx/fy.
- Around line 147-160: The color-tensor validation is incomplete: ensure the
tensor has an explicit channel dimension and correct dtype before treating it as
uchar3/uchar4. In the block where maybe_color is handled (use get_tensor(),
color_tensor, color_tensor_name_, color_channels, cshape, color_ptr), require
cshape.size() >= 3 and that static_cast<int>(cshape[2]) is 3 or 4, verify the
tensor dtype is uint8 (or the operator's expected unsigned 8-bit type) and that
H and W match depth; only after these checks set color_channels and assign
color_ptr. Add clear runtime_errors when the channel dimension is missing or
dtype is wrong.

In `@operators/depth_to_point_cloud/metadata.json`:
- Line 26: The first entry in the tags array currently uses "Point Cloud" which
is not an approved category; update the tags array so the first tag is an
approved category (e.g., "Robotics" or "Computer Vision and Perception") and
leave the remaining tags ("Point Cloud", "Depth", "3D", "Camera") after it,
ensuring the "tags" array's first element matches the approved category list in
metadata.json.

In `@operators/depth_to_point_cloud/test/test_deproject.cu`:
- Around line 66-166: Add explicit CUDA error checks after every CUDA API call
and kernel launch in this test: check return values of
cudaMalloc/cudaMemcpy/cudaFree and verify kernel launches by capturing
launch_deproject's returned cudaError_t (or call cudaGetLastError()) and
checking cudaDeviceSynchronize() results; update all places where
launch_deproject is invoked (Cases 1–4) to store/validate its return, and insert
CHECK(...) or equivalent assertions after each
cudaMalloc/cudaMemcpy/cudaDeviceSynchronize/cudaFree to fail fast on
allocation/copy/sync errors (refer to functions/variables: launch_deproject,
cudaMalloc, cudaMemcpy, cudaDeviceSynchronize, cudaFree, and the CHECK macro).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0d9ac9ec-6e51-491a-935d-cf9230e6e59b

📥 Commits

Reviewing files that changed from the base of the PR and between 6386681 and b6954b1.

📒 Files selected for processing (18)
  • applications/CMakeLists.txt
  • applications/depth_to_point_cloud_demo/CMakeLists.txt
  • applications/depth_to_point_cloud_demo/README.md
  • applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py
  • applications/depth_to_point_cloud_demo/metadata.json
  • operators/CMakeLists.txt
  • operators/depth_to_point_cloud/CMakeLists.txt
  • operators/depth_to_point_cloud/README.md
  • operators/depth_to_point_cloud/deproject.cu
  • operators/depth_to_point_cloud/deproject.hpp
  • operators/depth_to_point_cloud/depth_to_point_cloud.cpp
  • operators/depth_to_point_cloud/depth_to_point_cloud.hpp
  • operators/depth_to_point_cloud/metadata.json
  • operators/depth_to_point_cloud/python/CMakeLists.txt
  • operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp
  • operators/depth_to_point_cloud/test/CMakeLists.txt
  • operators/depth_to_point_cloud/test/test_deproject.cu
  • operators/depth_to_point_cloud/test_depth_to_point_cloud.py

Comment thread applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py
Comment thread applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py
Comment thread applications/depth_to_point_cloud_demo/metadata.json Outdated
Comment thread applications/depth_to_point_cloud_demo/metadata.json Outdated
Comment thread operators/depth_to_point_cloud/deproject.cu
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp Outdated
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/metadata.json Outdated
Comment thread operators/depth_to_point_cloud/test/test_deproject.cu Outdated
Signed-off-by: Nitheesh Kumar <snknitheesh@gmail.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
operators/depth_to_point_cloud/test/test_deproject.cu (1)

66-168: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Complete the CUDA error-checking coverage.

Progress since the last review: Cases 2–4 now check launch_deproject return values and cudaDeviceSynchronize. However, the following gaps remain:

  • Case 1 (line 72): cudaDeviceSynchronize() result is not checked.
  • All cases: cudaMalloc and cudaMemcpy calls are unchecked; silent allocation or copy failures could produce misleading test results.
Pattern to complete the checks

Case 1 example (lines 66–74):

-    cudaMalloc(&d_depth, N * sizeof(float));
-    cudaMalloc(&d_xyz, N * sizeof(float3));
-    cudaMemcpy(d_depth, depth.data(), N * sizeof(float), cudaMemcpyHostToDevice);
+    CHECK(cudaMalloc(&d_depth, N * sizeof(float)) == cudaSuccess, "Case1 cudaMalloc d_depth");
+    CHECK(cudaMalloc(&d_xyz, N * sizeof(float3)) == cudaSuccess, "Case1 cudaMalloc d_xyz");
+    CHECK(cudaMemcpy(d_depth, depth.data(), N * sizeof(float), cudaMemcpyHostToDevice) == cudaSuccess,
+          "Case1 H2D depth");
     cudaError_t err = launch_deproject(d_depth, DepthDType::kFloat32, 1.0f, k, dmin, dmax, invalid,
                                        nullptr, 0, d_xyz, nullptr, W, H, 0);
     CHECK(err == cudaSuccess, "Case1 launch returned error");
-    cudaDeviceSynchronize();
+    CHECK(cudaDeviceSynchronize() == cudaSuccess, "Case1 sync");
     std::vector<float3> out(N);
-    cudaMemcpy(out.data(), d_xyz, N * sizeof(float3), cudaMemcpyDeviceToHost);
+    CHECK(cudaMemcpy(out.data(), d_xyz, N * sizeof(float3), cudaMemcpyDeviceToHost) == cudaSuccess,
+          "Case1 D2H xyz");

Apply the same pattern to Cases 2–4 for their cudaMalloc and cudaMemcpy calls.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@operators/depth_to_point_cloud/test/test_deproject.cu` around lines 66 - 168,
The tests are missing CUDA error checks: ensure every cudaMalloc and cudaMemcpy
in all cases (variables d_depth, d_xyz, d_color, d_outcolor, etc.) checks the
returned cudaError_t and fails via CHECK on error, and in Case 1 also check the
result of cudaDeviceSynchronize (like you do in Cases 2–4); keep existing
launch_deproject checks as-is but add the same CHECK(cudaDeviceSynchronize() ==
cudaSuccess, ...) and CHECK(err == cudaSuccess, ...) pattern around each
cudaMalloc/cudaMemcpy and after the cudaDeviceSynchronize calls to guarantee
allocation/copy/sync failures are caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@operators/depth_to_point_cloud/test/test_deproject.cu`:
- Around line 66-168: The tests are missing CUDA error checks: ensure every
cudaMalloc and cudaMemcpy in all cases (variables d_depth, d_xyz, d_color,
d_outcolor, etc.) checks the returned cudaError_t and fails via CHECK on error,
and in Case 1 also check the result of cudaDeviceSynchronize (like you do in
Cases 2–4); keep existing launch_deproject checks as-is but add the same
CHECK(cudaDeviceSynchronize() == cudaSuccess, ...) and CHECK(err == cudaSuccess,
...) pattern around each cudaMalloc/cudaMemcpy and after the
cudaDeviceSynchronize calls to guarantee allocation/copy/sync failures are
caught.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ef060d9-b50f-4db2-8bdc-7906198b4c69

📥 Commits

Reviewing files that changed from the base of the PR and between b6954b1 and 5dc0068.

📒 Files selected for processing (5)
  • applications/depth_to_point_cloud_demo/CMakeLists.txt
  • operators/depth_to_point_cloud/deproject.cu
  • operators/depth_to_point_cloud/depth_to_point_cloud.cpp
  • operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp
  • operators/depth_to_point_cloud/test/test_deproject.cu
🚧 Files skipped from review as they are similar to previous changes (4)
  • applications/depth_to_point_cloud_demo/CMakeLists.txt
  • operators/depth_to_point_cloud/deproject.cu
  • operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp
  • operators/depth_to_point_cloud/depth_to_point_cloud.cpp

Signed-off-by: Nitheesh Kumar <snknitheesh@gmail.com>
Copilot AI review requested due to automatic review settings May 30, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/deproject.cu Outdated
Comment thread applications/depth_to_point_cloud_demo/CMakeLists.txt
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/test_depth_to_point_cloud.py
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
snknitheesh and others added 2 commits May 30, 2026 19:32
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Signed-off-by: Nitheesh Kumar <snknitheesh@gmail.com>
Copilot AI review requested due to automatic review settings May 30, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated 12 comments.

Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/deproject.cu
Comment thread applications/depth_to_point_cloud_demo/depth_to_point_cloud_demo.py
Comment thread applications/depth_to_point_cloud_demo/CMakeLists.txt
Comment thread operators/depth_to_point_cloud/test/test_deproject.cu
Comment thread operators/depth_to_point_cloud/python/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/metadata.json
Comment thread operators/depth_to_point_cloud/depth_to_point_cloud.cpp
Comment thread operators/depth_to_point_cloud/README.md Outdated
Signed-off-by: Nitheesh Kumar <snknitheesh@gmail.com>
@tbirdso
tbirdso requested a review from a team June 1, 2026 11:36
snknitheesh and others added 2 commits June 8, 2026 14:23

@bhashemian bhashemian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snknitheesh thanks for this interesting contribution. I reviewed and left some comments inline. I'd appreciate it if you could address them.

Comment thread applications/depth_to_point_cloud_demo/README.md Outdated
operator. It generates a synthetic organized depth image (a gently tilting plane) plus an aligned
RGB image entirely on the GPU, deprojects it into an organized `H x W x 3` point cloud, and reports
the valid-point count and Z range each frame. No camera or dataset is required.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a splash image for this application? It could be anything that can represent this application, such as diagram, screenshot, or any elaborated illustration. Thanks

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snknitheesh, do you have a timeline for this? Thanks

Comment thread applications/depth_to_point_cloud_demo/README.md Outdated
Comment thread applications/depth_to_point_cloud_demo/README.md Outdated
Comment thread operators/depth_to_point_cloud/README.md Outdated
@bhashemian
bhashemian dismissed their stale review July 14, 2026 17:30

Withdrawn at reviewer request.

@bhashemian bhashemian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the depth-to-point-cloud operator and CI-friendly demo.

Blocking:

  • applications/depth_to_point_cloud_demo/metadata.json advertises a realsense run mode whose description says it is not yet runnable from Python. HoloHub metadata should not expose a broken launcher. Could this mode please be removed until implemented, or replaced with a runnable path?

"realsense": {
"description": "Live Intel RealSense camera source (requires hardware; see README — not yet runnable from Python)",
"run": {
"command": "python3 <holohub_app_source>/depth_to_point_cloud_demo.py --source realsense",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking: This advertised run command points to a mode that the description says is not yet runnable from Python. HoloHub metadata should not expose a broken launcher. Could this mode be removed until implemented, or replaced with a runnable path?

@bhashemian bhashemian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the depth-to-point-cloud operator and demo update.

Blocking:

  • The realsense mode is still advertised in application metadata even though the command intentionally raises NotImplementedError. Could this mode please be removed until a runnable path is implemented, or replaced with working RealSense integration? This is required because HoloHub metadata should not expose a launcher that cannot run.
  • Current required workflows are marked action_required; those checks must be enabled and pass before merge.

@bhashemian bhashemian added the Action Required by Author An action is required by author to proceed with review and approval. label Jul 21, 2026
@greptile-apps

greptile-apps Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Action Required by Author An action is required by author to proceed with review and approval.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants