edgetpu.utils.dataset_utils

This API is deprecated: Instead try the PyCoral APIs.

Utilities to process dataset.

edgetpu.utils.dataset_utils.read_label_file(file_path)

Reads labels from text file and store it in a dict.

This function supports following formats:

  1. Each line contains id and description separated by colon or space. Example: ‘0:cat’ or ‘0 cat’.
  2. Each line contains description only. Label’s id equals to row number.
Parameters:file_path – String, path to the label file.
Returns:Dict of (int, string) which maps label id to description.