from_darknet_json#

from_darknet_json(dataset_path: Path, json_path: Path, ids_map: dict[int, dict[str, Any]], image_info: DataFrame | None, split_name: str = 'eval') Dataset[source]#

Same as from_darknet, expect the data file replaced with a json file containing directly annotations information. This is typically the format of predictions done by darknet’s detector.

Parameters:
  • dataset_path – folder containing the dataset, from which the relative path are given

  • json_path – json file containing a list of predictions as dictionaries. Each dictionary will have bbox info as well ad image path, which will be used to retrieve the original image id thanks to image_info DataFrame

  • ids_map – dictionary containing the id_remapping that was initially applied to create the darknet dataset. Will reverse it to get back to the original class mapping. The dictionary must have darknet dataset’s category ids (in sequential order then) as keys and with corresponding values that are dictionaries containing name and id keys relative to this class.

  • image_info – DataFrame containing image information. Must contain at least the following columns : relative_path, id, width, height

  • split_name – Name of the split that will be assigned to the split column of the resulting dataset’s annotation dataframe.

Returns:

Loaded dataset object