releaseGPUMemory
R2026bDescription
releaseGPUMemory( frees GPU
memory allocated by the vidSegmenter)sam2VideoObjectSegmenter object vidSegmenter during
model initialization and inference. Use this function to reclaim GPU resources after
completing segmentation, allowing additional models to run on the GPU.
Examples
Input Arguments
Tips
After calling
releaseGPUMemory, callingsegmentObjectson the same object may require the model to be reloaded, which incurs additional startup time.This function has no effect when the segmenter was created with
ExecutionEnvironment="cpu".
Version History
Introduced in R2026b