ed_sensor_integration
Classes | Public Member Functions | Private Attributes | List of all members
SamSegPipeline Class Reference

Segmentation pipeline class that maintains YOLO and SAM models state. This prevents initializing heavy models iteratively on every frame. More...

#include <sam_seg_module.h>

Classes

struct  Impl
 

Public Member Functions

void initialize (tue::Configuration &config)
 Initialize the YOLO and SAM models from configuration. More...
 
SegmentationResult process (const cv::Mat &img, const cv::Mat &depth_image=cv::Mat(), const std::string &ignore_label="", bool verbose=false)
 Process the input image and generate segmentation masks. More...
 
 SamSegPipeline ()
 
 ~SamSegPipeline ()
 

Private Attributes

std::atomic< bool > is_initialized_
 
std::unique_ptr< Impl > pimpl_
 

Detailed Description

Segmentation pipeline class that maintains YOLO and SAM models state. This prevents initializing heavy models iteratively on every frame.

Definition at line 47 of file sam_seg_module.h.

Constructor & Destructor Documentation

◆ SamSegPipeline()

SamSegPipeline::SamSegPipeline ( )

Definition at line 27 of file sam_seg_module.cpp.

◆ ~SamSegPipeline()

SamSegPipeline::~SamSegPipeline ( )
default

Member Function Documentation

◆ initialize()

void SamSegPipeline::initialize ( tue::Configuration &  config)

Initialize the YOLO and SAM models from configuration.

Parameters
configConfiguration containing model paths.

Definition at line 31 of file sam_seg_module.cpp.

◆ process()

SegmentationResult SamSegPipeline::process ( const cv::Mat &  img,
const cv::Mat &  depth_image = cv::Mat(),
const std::string &  ignore_label = "",
bool  verbose = false 
)

Process the input image and generate segmentation masks.

Parameters
imgThe input RGB image to segment.
depth_imageOptionally, the filtered depth image to ignore bounding boxes outside our point cloud frustum.
ignore_labelOptionally, a specific YOLO label to skip inferring SAM on.
verboseIf true, measure and populate latency timings.
Returns
SegmentationResult The generated masks, bounding boxes, labels, and confidences.

Definition at line 71 of file sam_seg_module.cpp.

Member Data Documentation

◆ is_initialized_

std::atomic<bool> SamSegPipeline::is_initialized_
private

Definition at line 72 of file sam_seg_module.h.

◆ pimpl_

std::unique_ptr<Impl> SamSegPipeline::pimpl_
private

Definition at line 70 of file sam_seg_module.h.


The documentation for this class was generated from the following files: