NVIDIA TAO Toolkit v4.0.1
NVIDIA TAO Release 4.0.1

Annotation

The Annotation service for TAO Data Services helps users easily convert groundtruth labels from one format to another.

Currently, the Annotation service supports KITTI and (COCO formats.

The following is a sample spec file for converting a COCO dataset to KITTI format. It has three key components–data, kitti, and coco–as well as a global parameter, all of which are explained below in detail.

Copy
Copied!
            

data: input_format: "COCO" output_format: "KITTI" output_dir: "/workspace/output" kitti: image_dir: "/workspace/kitti/images" label_dir: "/workspace/kitti/labels" mapping: "/workspace/kitti_mapping.json" coco: ann_file: "/workspace/coco.json" results_dir: "/path/to/results"

Field

Description

Data Type and Constraints

Recommended/Typical Value

results_dir

The directory to save the annotation-conversion log to

string

data

The dataset config

Dict

kitti

The KITTI config

Dict

coco

The COCO config

Dict

Data Config

The data configuration (data) specifies the source and target formats of the label conversion, as well as the output path.

Field

Description

Data Type and Constraints

Recommended/Typical Value

input_format

The input data format (either “KITTI” or “COCO”)

string

output_format

The output data format (either “KITTI” or “COCO”)

string

output_dir

The path to save the converted annotations

string

KITTI Config

The KITTI configuration (kitti) specifies the KITTI dataset information.

Field

Description

Data Type and Constraints

Recommended/Typical Value

image_dir

The image directory

string

label_dir

THe label directory

string

project

The project name, which is used as the scene_id when converting to COCO format. The default value is the parent directory name of the image_dir.

string

mapping

A YAML file specifying the category mappings. If this value is not not specified, all categories in the label_dir will be used).

string

Here is an example of a category mapping file:

Copy
Copied!
            

- person: - person - Person - person_group - rider - bag: - hand_bag - backpack - personal_bag - face: - face


COCO Config

The COCO configuration (coco) specifies the COCO annotation file location.

Field

Description

Data Type and Constraints

Recommended/Typical Value

ann_file

The annotation file

string

The annotation service supports the following tasks:

  • convert: Converts data between KITTI format and COCO format.

It can be invoked from the TAO Toolkit Launcher using the following convention on the command-line:

Copy
Copied!
            

tao dataset annotations generate [-h] -e <experiment spec> [-r <results_dir>]

Required Arguments

  • -e, --experiment_spec_file: The experiment specification file

Optional Arguments

  • -h, --help: Show this help message and exit.

Here’s an example of using the convert command in Data Services:

Copy
Copied!
            

tao dataset annotations convert -e /path/to/spec.yaml


© Copyright 2023, NVIDIA.. Last updated on Jul 27, 2023.