Skip to content

Colonoscopy Polyp Segmentation#

Authors: Holoscan Team (NVIDIA)
Supported platforms: x86_64, aarch64
Language: Python
Last modified: August 20, 2025
Latest version: 1.0
Minimum Holoscan SDK version: 0.5.0
Tested Holoscan SDK versions: 0.5.0
Contribution metric: Level 1 - Highly Reliable

Full workflow including a generic visualization of segmentation results from a polyp segmentation models.

Quick Start#

./holohub run colonoscopy_segmentation

Requirements#

  • Python 3.8+
  • The provided applications are configured to either use the AJA capture card for input stream, or a pre-recorded video of the colonoscopy data (replayer). Follow the setup instructions from the user guide to use the AJA capture card.

Data#

📦️ (NGC) Sample App Data for AI Colonoscopy Segmentation of Polyps

The data is automatically downloaded and converted to the correct format when building the application. If you want to manually convert the video data, please refer to the instructions for using the convert_video_to_gxf_entities script.

Build Instructions#

To build the application in a runtime container:

./holohub build colonoscopy_segmentation

Or, to build the application in the host environment, install the application dependencies and then run:

./holohub build --local colonoscopy_segmentation

Run Instructions#

Application Presets#

To run the application with the pre-recorded colonoscopy sample video

./holohub run colonoscopy_segmentation replayer

To run the application with input from an AJA video capture card:

./holohub run colonoscopy_segmentation aja

Application Configurations#

To pass runtime arguments to the application:

./holohub run colonoscopy_segmentation --run-args="--contours --source=\"replayer\""

CLI Parameters#

usage: colonoscopy_segmentation.py [-h] [-s {replayer,aja}] [-c CONFIG] [-d DATA] [--contours | --no-contours]

Colonoscopy segmentation demo application.

options:
  -h, --help            show this help message and exit
  -s {replayer,aja}, --source {replayer,aja}
                        If 'replayer', replay a prerecorded video. If 'aja' use an AJA capture card as the source (default: replayer).
  -c CONFIG, --config CONFIG
                        Set config path to override the default config file location
  -d DATA, --data DATA  Set the data path
  --contours, --no-contours
                        Show segmentation contours instead of mask (default: False)

VS Code Dev Container#

To start the the Dev Container, run the following command from the root directory of Holohub:

./holohub vscode

VS Code Launch Profiles#

There are two launch profiles configured for this application:

  1. (debugpy) colonoscopy_segmentation/python: Launch colonoscopy_segmentation using a launch profile that enables debugging of Python code.
  2. (pythoncpp) colonoscopy_segmentation/python: Launch colonoscopy_segmentation using a launch profile that enables debugging of Python and C++ code.

Note: the launch profile starts the application with Video Replayer. To adjust the arguments of the application, open launch.json, find the launch profile named (debugpy) colonoscopy_segmentation/python, and adjust the args field as needed.