-
Notifications
You must be signed in to change notification settings - Fork 127
mmiranda nvidia style edits to surgical scene reconstruction #1329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 8 commits
7ba449c
9c5ba36
cb9eb17
c5b9657
b8e97b9
3a688e5
183875e
4e982f8
5350154
1a71b0d
050a7e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,16 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||
| # Surgical Scene Reconstruction with Gaussian Splatting | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Real-time 3D surgical scene reconstruction using Gaussian Splatting in a Holoscan streaming pipeline with temporal deformation for accurate tissue modeling. | ||||||||||||||||||||||||||||||||||||||||
| This application demonstrates real-time 3D surgical scene reconstruction by combining **Holoscan SDK** for high-performance streaming, **3D Gaussian Splatting** for neural 3D representation, and **temporal deformation networks** for accurate modeling of dynamic tissue. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
megnvidia marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
| ## Overview | ||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| This application demonstrates real-time 3D surgical scene reconstruction by combining **Holoscan SDK** for high-performance streaming, **3D Gaussian Splatting** for neural 3D representation, and **temporal deformation networks** for accurate modeling of dynamic tissue. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| The application provides a complete end-to-end pipeline—from raw surgical video to real-time 3D reconstruction—enabling researchers and developers to train custom models on their own endoscopic data and visualize results with GPU-accelerated rendering. | ||||||||||||||||||||||||||||||||||||||||
| The application provides a complete end-to-end pipeline—from raw surgical video to real-time 3D reconstruction. Researchers and developers can use it to train custom models on their own endoscopic data and visualize results with GPU-accelerated rendering. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Key Features | ||||||||||||||||||||||||||||||||||||||||
| Features of this application include: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - **Real-time Visualization:** Stream surgical scene reconstruction at >30 FPS using Holoscan | ||||||||||||||||||||||||||||||||||||||||
| - **Temporal Deformation:** Accurate per-frame tissue modeling as it deforms over time | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -19,13 +17,9 @@ The application provides a complete end-to-end pipeline—from raw surgical vide | |||||||||||||||||||||||||||||||||||||||
| - **Two Operation Modes:** Inference-only (with pre-trained checkpoint) OR train-then-render | ||||||||||||||||||||||||||||||||||||||||
| - **Production Ready:** Tested and optimized Holoscan pipeline with complete Docker containerization | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### What It Does | ||||||||||||||||||||||||||||||||||||||||
| It takes input from EndoNeRF surgical datasets (RGB images + stereo depth + camera poses + tool masks). It processes the input using multi-frame Gaussian Splatting with a 4D spatiotemporal deformation network. And it outputs real-time 3D tissue reconstruction without surgical instruments. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - **Input:** EndoNeRF surgical dataset (RGB images + stereo depth + camera poses + tool masks) | ||||||||||||||||||||||||||||||||||||||||
| - **Process:** Multi-frame Gaussian Splatting with 4D spatiotemporal deformation network | ||||||||||||||||||||||||||||||||||||||||
| - **Output:** Real-time 3D tissue reconstruction without surgical instruments | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Use Cases | ||||||||||||||||||||||||||||||||||||||||
| It is ideal for use cases, such as: | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: "uses cases" should be "use cases"
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - Surgical scene understanding and visualization | ||||||||||||||||||||||||||||||||||||||||
| - Tool-free tissue reconstruction for analysis | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -34,7 +28,7 @@ The application provides a complete end-to-end pipeline—from raw surgical vide | |||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ## Quick Start | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Step 1: Clone HoloHub | ||||||||||||||||||||||||||||||||||||||||
| ### Step 1: Clone the HoloHub Repository | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| git clone https://github.com/nvidia-holoscan/holohub.git | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -43,31 +37,35 @@ cd holohub | |||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Step 2: Read and Agree to the Terms and Conditions of the EndoNeRF Sample Dataset | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - Read and agree to the [Terms and Conditions](https://docs.google.com/document/d/1P6q2hXoGpVMKeD-PpjYYdZ0Yx1rKZdJF1rXxpobbFMY/edit?usp=share_link) for the EndoNeRF dataset. | ||||||||||||||||||||||||||||||||||||||||
| - EndoNeRF sample dataset is being downloaded automatically when building the application. For manual download, please refer to the [Data](#data) section below. | ||||||||||||||||||||||||||||||||||||||||
| - If you do not agree to the terms and conditions, set the `HOLOHUB_DOWNLOAD_DATASETS` environment variable to `OFF` and manually download the dataset and place it in the correct location by following the instructions in the [Data](#data) section below. | ||||||||||||||||||||||||||||||||||||||||
| 1. Read and agree to the [Terms and Conditions](https://docs.google.com/document/d/1P6q2hXoGpVMKeD-PpjYYdZ0Yx1rKZdJF1rXxpobbFMY/edit?usp=share_link) for the EndoNeRF dataset. | ||||||||||||||||||||||||||||||||||||||||
| 1. EndoNeRF sample dataset is being downloaded automatically when building the application. | ||||||||||||||||||||||||||||||||||||||||
| 1. Optionally, for manual download of the dataset, refer to the [Data](#pulling-soft-tissues-dataset) section below. | ||||||||||||||||||||||||||||||||||||||||
| 1. Optionally, if you do not agree to the terms and conditions, set the `HOLOHUB_DOWNLOAD_DATASETS` environment variable to `OFF` and manually download the dataset and place it in the correct location by following the instructions in the [Data](#pulling-soft-tissues-dataset) section below. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| export HOLOHUB_DOWNLOAD_DATASETS=OFF | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| export HOLOHUB_DOWNLOAD_DATASETS=OFF | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Step 3: Run Training | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| To run the model training: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
megnvidia marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| ./holohub run surgical_scene_recon train | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
| ./holohub run surgical_scene_recon train | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
54
to
+55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicate command with incorrect indentation
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
54
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inconsistent indentation - code block is indented but other code blocks in Quick Start section are not
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Comment on lines
53
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: Duplicate command - line 54 and 55 both contain
Suggested change
Comment on lines
54
to
+56
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. syntax: duplicate command and broken code block - line 54 is duplicated on line 55, and the closing backticks are on the wrong indentation level
Suggested change
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Step 4: Dynamic Rendering with Trained Model | ||||||||||||||||||||||||||||||||||||||||
| ### Step 4: Dynamic Rendering with a Trained Model | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| After training completes, visualize your results in real-time: | ||||||||||||||||||||||||||||||||||||||||
| After training completes, to visualize your results in real-time, run the surgical render: | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "run the surgical render" is awkward - not a standard technical term
Suggested change
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| ./holohub run surgical_scene_recon render | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ## Data | ||||||||||||||||||||||||||||||||||||||||
| ## Pulling Soft Tissues Dataset | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| This application uses the **EndoNeRF "pulling_soft_tissues" dataset**, which contains: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
@@ -76,36 +74,43 @@ This application uses the **EndoNeRF "pulling_soft_tissues" dataset**, which con | |||||||||||||||||||||||||||||||||||||||
| - Tool segmentation masks for instrument removal | ||||||||||||||||||||||||||||||||||||||||
| - Camera poses and bounds (poses_bounds.npy) | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Download | ||||||||||||||||||||||||||||||||||||||||
| ### Download the Dataset | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| You can download the dataset from one of the following locations: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| 📦 **Direct Google Drive:** <https://drive.google.com/drive/folders/1zTcX80c1yrbntY9c6-EK2W2UVESVEug8?usp=sharing> | ||||||||||||||||||||||||||||||||||||||||
| * 📦 Direct Google Drive: <https://drive.google.com/drive/folders/1zTcX80c1yrbntY9c6-EK2W2UVESVEug8?usp=sharing> | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| In the Google Drive folder, you'll see: | ||||||||||||||||||||||||||||||||||||||||
| 1. In the Google Drive folder, you'll see: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| - `cutting_tissues_twice` | ||||||||||||||||||||||||||||||||||||||||
| - `pulling_soft_tissues` ← **Download this one** | ||||||||||||||||||||||||||||||||||||||||
| - `cutting_tissues_twice` | ||||||||||||||||||||||||||||||||||||||||
| - `pulling_soft_tissues` | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| 1. Download `pulling_soft_tissues`. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| **Alternative:** Visit the [EndoNeRF repository](https://github.com/med-air/EndoNeRF) | ||||||||||||||||||||||||||||||||||||||||
| * Visit the [EndoNeRF repository](https://github.com/med-air/EndoNeRF). | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Dataset Setup | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| The dataset will be automatically used by the application when placed in the correct location. Refer to the [HoloHub glossary](../../README.md#Glossary) for definitions of HoloHub-specific directory terms used below. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Place the dataset at `<HOLOHUB_ROOT>/data/EndoNeRF/pulling/`: | ||||||||||||||||||||||||||||||||||||||||
| To place the dataset at `<HOLOHUB_ROOT>/data/EndoNeRF/pulling/`: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| # From the HoloHub root directory | ||||||||||||||||||||||||||||||||||||||||
| mkdir -p data/EndoNeRF | ||||||||||||||||||||||||||||||||||||||||
| 1. From the HoloHub root directory: | ||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| mkdir -p data/EndoNeRF | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Extract and move (or copy) the downloaded dataset | ||||||||||||||||||||||||||||||||||||||||
| mv /path/to/pulling_soft_tissues data/EndoNeRF/pulling | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
| 1. Extract and move (or copy) the downloaded dataset: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| **⚠️ Important:** The dataset MUST be physically at the path above—do NOT use symlinks! Docker containers cannot follow symlinks outside mounted volumes. | ||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||
| mv /path/to/pulling_soft_tissues data/EndoNeRF/pulling | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Verify Dataset Structure | ||||||||||||||||||||||||||||||||||||||||
| **Important:** The dataset MUST be physically at the path above, do NOT use symlinks. Docker containers cannot follow symlinks outside mounted volumes. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Your dataset should have this structure: | ||||||||||||||||||||||||||||||||||||||||
| ### Verify the Dataset Structure | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| Verify that your dataset has this structure: | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ```text | ||||||||||||||||||||||||||||||||||||||||
| <HOLOHUB_ROOT>/ | ||||||||||||||||||||||||||||||||||||||||
|
|
@@ -118,39 +123,55 @@ Your dataset should have this structure: | |||||||||||||||||||||||||||||||||||||||
| └── poses_bounds.npy # Camera poses (8.5 KB) | ||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ## Model | ||||||||||||||||||||||||||||||||||||||||
| ## Models Used by the `surgical_scene_recon` Application | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| The `surgical_scene_recon` application uses a **3D Gaussian Splatting** model with a **temporal deformation network** for dynamic scene reconstruction. | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| The application uses **3D Gaussian Splatting** with a **temporal deformation network** for dynamic scene reconstruction: | ||||||||||||||||||||||||||||||||||||||||
| - Gaussian Splatting Model | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| ### Gaussian Splatting | ||||||||||||||||||||||||||||||||||||||||
| Each portion of the application makes use of different aspects of the Gaussian Splatting Model. | ||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This sentence is vague and doesn't add meaningful information. What "different aspects" does it refer to? Consider removing or making it more specific. Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes a vague lead in -- twas my attempt to try to add some explanation for what the bullet list is trying to be. Ideal would be adding other words that help make the bullets make sense, but I need some feedback on what the list is trying to accomplish |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
megnvidia marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||
| - **Architecture:** 3D Gaussians with learned position, scale, rotation, opacity, and color | ||||||||||||||||||||||||||||||||||||||||
| - **Initialization:** Multi-frame point cloud (~30,000-50,000 points from all frames) | ||||||||||||||||||||||||||||||||||||||||
| - **Renderer:** gsplat library (CUDA-accelerated differentiable rasterization) | ||||||||||||||||||||||||||||||||||||||||
| - **Spherical Harmonics:** Degree 3 (16 coefficients per gaussian for view-dependent color) | ||||||||||||||||||||||||||||||||||||||||
| - **Resolution:** 640×512 pixels (RGB, 3 channels) | ||||||||||||||||||||||||||||||||||||||||
| - Architecture: 3D Gaussian with learned position, scale, rotation, opacity, and color | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
| - Architecture: 3D Gaussian with learned position, scale, rotation, opacity, and color | |
| - Architecture: 3D Gaussians with learned position, scale, rotation, opacity, and color |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3D Gaussian should be 3D Gaussians (plural) to match the original description and be technically correct, as the model uses multiple Gaussian primitives.
| - Architecture: 3D Gaussian with learned position, scale, rotation, opacity, and color | |
| - Architecture: 3D Gaussians with learned position, scale, rotation, opacity, and color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description incorrect - mentions MRI data and forecast future frames, but this application uses surgical endoscopy video for tissue reconstruction, not MRI
| The Temporal Deformation Network enables dynamic scene modeling by deforming the base Gaussian representations over time to accurately capture tissue movement and deformation during surgery. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect description for Temporal Deformation Network - mentions MRI data and TGN which are not part of this surgical endoscopy application
| The Temporal Deformation Network deforms 3D Gaussians over time to model dynamic tissue movement during surgery. | |
| The Temporal Deformation Network uses a HexPlane-based 4D spatiotemporal grid representation to model tissue deformation over time in surgical scenes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I think this part is going to continue to make the AI mad. The AI and myself are both attempting to add clarity but I think we need an actual subject matter expert to weigh in. Please help us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 120/126 the title of Model. What model are we talking here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@finalelement could you please help here?