Segmentation Agent
SegmentationAgent
Bases: SensoryAgent
An image segmentation agent that uses a remote segmentation server to segment objects in an image.
Source code in mbodied/agents/sense/segmentation_agent.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
act(image, input_data, *args, api_name='/segment', **kwargs)
Perform image segmentation using the remote segmentation server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
Image
|
The image to act on. |
required |
input_data
|
Union[BBox2D, List[BBox2D], PixelCoords]
|
The input data for segmentation, either a bounding box, a list of bounding boxes, or pixel coordinates. |
required |
*args
|
Variable length argument list. |
()
|
|
api_name
|
str
|
The name of the API endpoint to use. |
'/segment'
|
**kwargs
|
Arbitrary keyword arguments. |
{}
|
Returns:
Type | Description |
---|---|
tuple[Image, ndarray]
|
Tuple[Image, np.ndarray]: The segmented image and the masks of the segmented objects. |
Source code in mbodied/agents/sense/segmentation_agent.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|