Cli
auto(ctx, task, image_path, model_src, api_key, params)
Dynamically select and run the correct agent based on the task.
Example command
mbodied auto language --params "{\"instruction\": \"Tell me a math joke?\"}"
Response
Why was the equal sign so humble? Because it knew it wasn't less than or greater than anyone else!
Example command
mbodied auto motion-openvla --params "{\"instruction\": \"Move forward\", \"image\": \"resources/bridge_example.jpeg\"}" --model-src "https://api.mbodi.ai/community-models/"
Response
Response: HandControl(pose={'x': -0.00960310545, 'y': -0.0111081966, 'z': -0.00206002074, 'roll': 0.0126330038, 'pitch': -0.000780597846, 'yaw': -0.0177964902}, grasp={'value': 0.996078431})
Inputs
[task]: Task to be executed by the agent. Choices include: - language: Run language-related tasks. - motion-openvla: Use the OpenVlaAgent to generate robot motion. - sense-object-detection: Run object detection tasks. - sense-image-segmentation: Run image segmentation tasks. - sense-depth-estimation: Run depth estimation tasks.
[image-path]: (Optional) Path to an image file, required for sense and motion tasks. [model-src]: The source of the model, e.g., "openai", "gradio", etc. [api-key]: (Optional) API key for accessing the remote model. [params]: The parameters for the agent.
Outputs
[Response]: The output generated by the selected agent based on the task, such as HandControl for motion or detected objects for sensing tasks.
Source code in mbodied/agents/cli.py
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
|
cli(ctx, verbose, dry_run, list, help)
CLI for various AI agents.
Source code in mbodied/agents/cli.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
detect_objects(ctx, image_filename, model_src, objects, model_type, api_name, list)
Run the ObjectDetectionAgent to detect objects in an image.
Example command
mbodied sense detect resources/color_image.png --objects "remote, spoon" --model-type "YOLOWorld"
Response
Annotated Image: The image with detected objects highlighted and labeled.
Inputs
[image_filename]: Path to the image file. [objects]: Comma-separated list of objects to detect (e.g., "car, person"). [model_type]: Model type to use for detection (e.g., "YOLOWorld", "Grounding DINO").
Outputs
[Annotated Image]: Display of the image with detected objects and their bounding boxes.
API documentation: https://api.mbodi.ai/sense/
Source code in mbodied/agents/cli.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
estimate_depth(ctx, image_filename, model_src, api_name, list)
Run the DepthEstimationAgent to estimate depth from an image.
Example command
mbodied sense depth path/to/image.png
Response
Depth map image displaying the estimated depth information for each pixel.
Inputs
[image_filename]: Path to the image file (e.g., PNG or RGBD image).
Outputs
[Depth Estimation Response]: A depth map image representing the depth information in the image.
Loaded as API: https://api.mbodi.ai/sense/depth API Endpoint: /depth
Source code in mbodied/agents/cli.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 |
|
language_chat(ctx, model_src, api_key, context, instruction, image_path, loop)
Run the LanguageAgent to interact with users using natural language.
Example command
mbodied language --instruction "What type of robot is this?" --image-path resources/color_image.png
Response
This is a robotic arm, specifically a PR2 (Personal Robot 2) developed by Willow Garage.
Inputs
[model_src]: The model source for the LanguageAgent (e.g., openai, anthropic, or a gradio URL). [api_key]: Optional API key for the remote actor, if needed. [context]: Starting context for the conversation (optional). [instruction]: Instruction or query for the LanguageAgent to respond to. [image_path]: Optional path to an image file to include as part of the input. [loop]: If set, the agent will continue running and accepting new instructions.
Outputs
[Response]: The natural language response generated by the LanguageAgent.
Source code in mbodied/agents/cli.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
list_agents(verbose)
List available agents.
Source code in mbodied/agents/cli.py
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 |
|
motion(ctx, list)
Commands related to robot motion tasks.
Source code in mbodied/agents/cli.py
349 350 351 352 353 354 355 356 357 358 359 360 |
|
openvla_motion(ctx, instruction, image_filename, model_src, unnorm_key)
Run the OpenVlaAgent to generate robot motion based on instruction and image.
Example command
mbodied motion openvla resources/xarm.jpeg --instruction "move forward"
Response
Motion Response: HandControl( pose=Pose6D( x=-0.000432461563, y=0.000223397129, z=-0.000241243806, roll=-0.000138880808, pitch=0.00122899628, yaw=-6.67113405e-05 ), grasp=JointControl(value=0.996078431) )
Inputs
[image_filename]: Path to the image file. [instruction]: Instruction for the robot to act on.
Outputs
[Motion Response]: HandControl object containing pose and grasp information.
Loaded as API: https://api.mbodi.ai/community-models/
Source code in mbodied/agents/cli.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
|
segment(ctx, image_filename, model_src, segment_type, segment_input, api_name, list)
Run the SegmentationAgent to segment objects in an image.
Example command
mbodied sense segment resources/color_image.png --segment-type "bbox" --segment-input "50,50,150,150"
Response
Masks shape: (1, 720, 1280)
Inputs
[image_filename]: Path to the image file.
[segment-type]: The type of segmentation input, either bbox
for bounding box or coords
for pixel coordinates.
[segment-input]: The input data, either bounding box coordinates as x1,y1,x2,y2
or pixel coordinates as u,v
.
Outputs
[Masks]: A 2D mask indicating the segmented region in the image.
Loaded as API: https://api.mbodi.ai/sense/segment API Endpoint: /segment
Source code in mbodied/agents/cli.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
|
sense(ctx, list)
Commands related to sensing tasks (detection, segmentation, depth estimation).
Source code in mbodied/agents/cli.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
version()
Display the version of mbodied.
Source code in mbodied/agents/cli.py
487 488 489 490 |
|