Skip to content

Automatic Ground Truth Generation (AGTG)

The AGTG pipeline describes the stages for automating the annotation process of a dataset. There are two modes of operation.

  1. Fully Automatic: This is invoked at the time of importing the dataset as a snapshot and as a background process which deploys a detection model to drive SAM2.
  2. Semi-Automatic: This is invoked when users trigger the "AI Segment Tool" inside the dataset gallery. Users can select portions of the dataset to auto-annotate, but SAM2 requires initial annotations from the users as prompts.

Fully Automatic Ground Truth Generation

This annotation feature is available at the time of importing the dataset via snapshot restoration. The auto-annotation process is done in the background allowing the user to focus on separate tasks. This section will show the steps for performing this type of auto-annotation in EdgeFirst Studio. This feature can also be deployed using the EdgeFirst Client from the command line.

A complete description of dataset snapshots and related features can be found under Studio Snapshots.

This feature is a two-step process: Create Snapshot and Restore Snapshot.

Create Snapshot

Recall that snapshots are frozen and compact form of datasets. There are three ways of creating snapshots.

  1. Create from Existing Dataset

    On the dataset card, open the dataset context menu and select "Create Snapshot".

    Create Snapshot From Dataset
    Create Snapshot From Dataset

    Next enter the name for the dataset snapshot. Click on "Add Snapshot" to begin the snapshot creation.

    Name the Snapshot
    Name the Snapshot

  2. Upload from MCAP File

    An MCAP file is a recording captured by an EdgeFirst Platform such as a Maivin or a Raivin.

    To create a snapshot from an MCAP file, visit the "Snapshots" page.

    Snapshots Page
    Snapshots Page

    Either drag and drop an MCAP file into the page OR click on the "From File" button to allow selection of the MCAP file from your directories.

    MCAP Import Snapshot
    MCAP Import Snapshot

  3. Upload from ZIP/Arrow (EdgeFirst Dataset) Files

    The ZIP/Arrow files together forms the EdgeFirst Dataset Format.

    To create a snapshot from ZIP/Arrow files, visit the "Snapshots" page.

    Snapshots Page
    Snapshots Page

    Either drag and drop the ZIP/Arrow files into the page OR click on the "From File" button to allow selection of the ZIP/Arrow files from your directories.

    ZIP/Arrow Import Snapshot
    ZIP/Arrow Import Snapshot

    Uniform Names

    The name of corresponding ZIP and Arrow files must be same.

    ZIP/Arrow File pairs

    The upload must come into ZIP and Arrow file pairs. If there are multiple ZIP and Arrow pairs, then each pair will become a sequence.

A snapshot can be created from one of the three ways as described above: Create from Existing Dataset, Upload from MCAP File, Upload from ZIP/Arrow File. The next section will show how to restore these created snapshots for auto-annotations.

Restore Snapshot

The snapshot restoration process involves several dataset transformations such as the frame rate specification, depth map generation, and auto-annotations. More information can be found in Studio.

The created snapshots can be found in the "Snapshots" page.

Snapshots Page
Snapshots Page

To restore the snapshot, click on the snapshot context menu and select "Restore".

Restore Snapshots
Restore Snapshots

Restoring a snapshot will create a new dataset entirely with annotations. Specify the project to contain this new dataset and specify the name and the description of the dataset. Furthermore, select the method for annotating the dataset. We recommend the second option, which deploys a pretrained YOLOX model to annotate the dataset with COCO classes. If you need to auto-annotate with your own custom classes, you will need a model trained in Studio with your custom classes.

Restore Snapshots Fields
Restore Snapshots Fields

Click "Start App" to start the annotation process. The progress is reported in the "Tasks" page.

Restore Snapshots Progress
Restore Snapshots Progress

Once completed, the new dataset will now contain annotations that resulted from the auto-annotation process. You can also click on the dataset link shown above to navigate directly to the created dataset.

Restored Dataset
Restored Dataset

Next navigate to the gallery of the dataset by clicking on the gallery button. The 2D annotations for both segmentation masks and bounding boxes should have been auto-generated in the background.

Restored Annotations
Restored Annotations

The next section will describe the Semi-Automatic Ground Truth Generation for additional user control during the auto-annotation process.

Semi-Automatic Ground Truth Generation

This annotation feature is available after importing the dataset into EdgeFirst Studio. This process occurs in the dataset gallery where the user has more control over the annotation process with the ability to annotate any object with custom classes. This feature will preload all frames of a video sequence in the dataset into SAM2 to generate segmentation masks, 2D bounding boxes, 3D bounding boxes (For Raivin/LiDAR Only) by tracking the object across the frames.

A complete description of this feature along with the functionalities of each buttons shown in this tutorial can be found under Studio.

This feature is a three-step process: Initialize AGTG Server, Annotate Starting Frame, Propagate.

Initialize AGTG Server

Inside the dataset gallery, click on the "AI Segment Tool" to start the AGTG server.

Auto Segment Mode
Auto Segment Mode

If there is currently no AGTG server available, go ahead and click on "Launch AGTG Server".

Launch AGTG Server
Launch AGTG Server

Please wait while the server is being initialized.

Launch AGTG Server
Launch AGTG Server

Active AGTG Server

This server is costing credits to run. An inactivity of 15 minutes will auto-terminate this server. Otherwise, once you have completed the annotations, please ensure to terminate the AGTG server by clicking "Shutdown AGTG Server" to avoid spending more of your credits.

Annotate Starting Frame

AGTG Preview

Once the server has been initialized, annotate the starting frame. This is the only annotation required by the user. The rest of the frames will be annotated by SAM2 and the AGTG process. This step is also known as initializing the SAM2 state. Each object must be annotated independently so the tracker can assign a unique ID.

Start by drawing a bounding box for the first object by clicking and dragging. For multiple objects in the frame, click "+" to add a new object as shown below. The process for each object should be: Add a new object -> Draw object prompt.

By default, the prompts provided to SAM2 are bounding boxes (mouse click and drag) which should cover the object to be annotated in the frame. However, points can also be provided (mouse clicks) by clicking areas that are part of the object.

AGTG Initial Prompts
AGTG Initial Prompts

Propagate

Once the first frame has been annotated (prompts for SAM2), specify the "End Frame" which marks the point where SAM2 stops propagating. By default this is the end of the sequence (last frame).

Large Tracks

We recommend keeping the tracks to less than 500 frames at a time. We observed unpredictable behavior from the tool when deploying tracks of ~1500 or higher.

Once this has been specified, click on "Propagate" to start the propagation process.

As the frames propagate, you should see the frames being auto-annotated. To stop the propagation process click on "Stop Propagation".

Propagation Process
Propagation Process

Once the propagation completes as it reached the end frame, click on "Save AIGT Annotations" to save the generated annotations.

Propagation Completed
Propagation Completed

Video Tutorials

This is a high level video tutorial shown an MCAP recording restored as a snapshot.

Next Steps

If you notice any errors on the annotations that require adjustments or any missing annotations that needs to be added, follow these tutorials that describe the manual annotation features.