Skip to content

Conversation

@horizon-blue
Copy link
Contributor

Closes MET-31.

Summary of Changes

This PR adds Image and ImageView classes:

  • Image is a host-side-only object that allocate & deallocate the memory buffers in device/host automatically via RAII.
  • ImageView is a non-owning view of Image which can be copy & pass around on either device or host (or between them).

I've added the basic Python bindings for both classes on both device types as well.

Test Plan

The cpp test (test_image.cu) illustrates how the two classes are expected to be used, checks that we can modify the underlying image buffer through ImageView, and shows that we can copy Image from device to host.

The python test (test_image.py) is pretty minimal at this point. It only checks that the bindings are created successfully, and that we can get the confidence and depth fields as 2D JAX arrays. This interface can be used to plot & visualize the image data as we start putting things together.

As always, you can run the included tests with

pixi run test

@linear
Copy link

linear bot commented Nov 30, 2025

MET-31 Implement `Image`

Definition of done:

  • The Array2D fields of Image should bind to numpy JAX arrays.

Copy link
Contributor

@arijit-dasgupta arijit-dasgupta left a comment

Choose a reason for hiding this comment

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

LGTM! I did not do too much of a deep dive, want to let you merge this asap. The tests look good and make sense.

@horizon-blue horizon-blue merged commit b4d4d7f into master Nov 30, 2025
1 check passed
@horizon-blue horizon-blue deleted the xiaoyan/image branch November 30, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants