MoveIt Pro API
Core Behaviors for MoveIt Pro
Loading...
Searching...
No Matches
moveit_pro::behaviors::GetMasks2DFromTextQueryInterface Class Reference

#include <clipseg_segmentation.hpp>

Public Member Functions

 GetMasks2DFromTextQueryInterface ()=default
 
virtual ~GetMasks2DFromTextQueryInterface ()=default
 
virtual void init (const std::filesystem::path &encoder_onnx_file, const std::filesystem::path &decoder_onnx_file)
 
virtual const moveit_pro_ml::ONNXImage & predict_mask (const moveit_pro_ml::ONNXImage &image, const std::vector< std::string > &prompts) const
 
virtual bool isUsingCpuFallback () const
 Returns true if either the CLIP or CLIPSeg model fell back to CPU execution.
 
virtual void requestTerminate () const
 Request termination of any in-flight predict_mask() call.
 
virtual void clearTerminate () const
 Clear a previously-set terminate flag.
 
bool isInitialized () const noexcept
 Returns true once init() has successfully constructed the underlying model.
 

Constructor & Destructor Documentation

◆ GetMasks2DFromTextQueryInterface()

moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::GetMasks2DFromTextQueryInterface ( )
default

◆ ~GetMasks2DFromTextQueryInterface()

virtual moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::~GetMasks2DFromTextQueryInterface ( )
virtualdefault

Member Function Documentation

◆ clearTerminate()

void moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::clearTerminate ( ) const
virtual

Clear a previously-set terminate flag.

Must be called before predict_mask() if the previous predict_mask() was halted, otherwise the next run aborts immediately. The behavior calls this at the start of doWork() before signalling that halt is allowed via notifyCanHalt().

◆ init()

void moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::init ( const std::filesystem::path &  encoder_onnx_file,
const std::filesystem::path &  decoder_onnx_file 
)
virtual

◆ isInitialized()

bool moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::isInitialized ( ) const
inlinenoexcept

Returns true once init() has successfully constructed the underlying model.

◆ isUsingCpuFallback()

virtual bool moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::isUsingCpuFallback ( ) const
inlinevirtual

Returns true if either the CLIP or CLIPSeg model fell back to CPU execution.

◆ predict_mask()

const moveit_pro_ml::ONNXImage & moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::predict_mask ( const moveit_pro_ml::ONNXImage &  image,
const std::vector< std::string > &  prompts 
) const
virtual

◆ requestTerminate()

void moveit_pro::behaviors::GetMasks2DFromTextQueryInterface::requestTerminate ( ) const
virtual

Request termination of any in-flight predict_mask() call.

Thread-safe; intended to be called from the behavior's doHalt() handler while another thread is blocked inside predict_mask(). The terminate flag is sticky; the caller is responsible for calling clearTerminate() before the next predict_mask() so a stale flag does not abort it.


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