Run your first action (CLI)#

This guide demonstrates how to invoke a Roboto Action on files in a dataset using the Roboto CLI. In this example, we’ll run the YOLOv8 object detection algorithm on image frames in a rosbag, leveraging a publicly available action from the Roboto Action Hub.

As before, we are working with sample data from from nuScenes by Motional, a well-known collection of autonomous driving imagery. While this example involves object detection, Roboto Actions are highly versatile and can be used to automate any type of data transformation, processing, or analysis workflow, tailored to your specific needs.

Preparation#

Create a dataset#

  1. With the CLI installed, run the following command in your terminal of choice:

    roboto datasets create
    

    Upon execution, you will receive a dataset_id, which is essential for subsequent steps. An example response looks like this:

    {
        ...
        "dataset_id": "ds_bopf33kzwisr",
        ...
    }
    
  1. Download this sample bag (nuscenes-tiny.bag) from S3. Once downloaded, upload it to your dataset:

    roboto datasets upload-files -d <dataset_id> -p ./nuscenes-tiny.bag
    

    To confirm the upload was successful, run:

    roboto datasets list-files -d <dataset_id>
    

    You should see the file appear in the dataset listing.

Invoke an action#

  1. Invoke the YOLOv8 action on the dataset by running the following command with the dataset_id created previously:

    roboto actions invoke roboto-public/run_yolov8_rosbag --dataset-id <dataset_id> --input-data '*.bag'
    

    You will receive an invocation_id. Keep it for tracking the status:

    Queued invocation of 'ActionReference(name='run_yolov8_rosbag',...)'. Invocation ID: 'iv_8j3getuyhp9u'
    
  2. You can use the CLI or Roboto’s web interface to monitor the invocation’s status:

    roboto invocations status <invocation_id> --tail
    
  3. Once completed, run the following command to inspect the dataset:

    roboto datasets list-files -d <dataset_id>
    

    Verify that the following files were added to the dataset by the action:

    nuscenes-tiny/
    ├── cam_front_raw/video.mp4            # a video with detections
    ├── cam_front_raw/imgs/*.jpg           # images from the rosbag
    └── cam_front_raw/imgs/detections.json # json file with detections
    

Create a trigger (optional)#

Tip

Triggers enable automated action invocation. Instead of manually invoking an action, you can set up a trigger to automatically invoke an action whenever a new file meeting specific criteria is uploaded to a dataset.

  1. Create a new trigger with the CLI:

    roboto triggers create --name run_yolo_rosbag_trigger --action roboto-public/run_yolov8_rosbag --required-inputs '*.bag' --for-each dataset_file
    

    This command does the following:

    • Creates a trigger named run_yolo_rosbag_trigger.

    • Associates this trigger with the roboto-public/run_yolov8_rosbag action.

    • Sets the trigger to monitor for any newly uploaded *.bag files in datasets. Once detected, it automatically invokes the associated action.

Conclusion#

And that’s it! You have now set up a trigger to automatically run the action on newly uploaded files. You can confirm the trigger exists on the Triggers page in the web app.

Explore our CLI reference for more information on the available commands.

In the next guide, we’ll walk through creating your own custom action, so you can tailor Roboto Actions to your unique data processing needs.