View source on GitHub
|
A task to perform interactive segmentation on images.
mp.tasks.vision.InteractiveSegmenter(
lib: serial_dispatcher.SerialDispatcher, handle: ctypes.c_void_p
)
Methods
close
close()
Closes the InteractiveSegmenter.
create_from_options
@classmethodcreate_from_options( options: InteractiveSegmenterOptions ) -> InteractiveSegmenter
Creates the InteractiveSegmenter object from options.
| Args | |
|---|---|
options
|
Options for the interactive segmenter task. |
| Returns | |
|---|---|
InteractiveSegmenter object.
|
segment
segment(
strokes: List[Stroke]
) -> image_module.Image
Performs segmentation on the previously set image.
set_image
set_image(
image: image_module.Image
) -> None
Sets the image to be segmented.
__enter__
__enter__()
Returns self upon entering the runtime context.
__exit__
__exit__(
exc_type, exc_value, traceback
)
Shuts down the MediaPipe task instance on exit of the context manager.
View source on GitHub