nicetoolbox.evaluation.in_out.IO

class nicetoolbox.evaluation.in_out.IO(io_config: EvaluationIO, experiment_io: DetectorsRunIO, cfg_loader: ConfigLoader)[source]

Bases: object

Manages folder structure and reading/writing NPZ results.

Initialize the IO manager with the provided IO configuration.

Parameters:

io_config (IOConfig) – Configuration object containing paths for experiment, output, and evaluation visualization folders.

Methods

get_csv_folder

Returns the path to the CSV folder within the output directory.

get_detector_results_file

Returns the path to the detector results file based on the video configuration, component, and algorithm.

get_out_folder

Returns the output folder path based on the provided parameters.

init_dataset

Dataset-specific IO initialization inside the main dataset loop.

save_npz

Save arrays to a compressed NPZ file.

save_summaries_to_csv

Save a summary dict to a CSV file.

Attributes

output_folder

eval_visualization_folder

experiment_folder

dataset_name

experiment_results_folder

path_to_annotations

path_to_calibrations

get_csv_folder()[source]

Returns the path to the CSV folder within the output directory.

get_detector_results_file(video_config, component, algorithm)[source]

Returns the path to the detector results file based on the video configuration, component, and algorithm.

Parameters:
  • video_config (RunConfigVideo) – Configuration for the video run.

  • component (str) – Name of the component.

  • algorithm (str) – Name of the algorithm.

Returns:

The path to the detector results file.

Return type:

Path

get_out_folder(selection='', component='')[source]

Returns the output folder path based on the provided parameters.

Parameters:
  • selection (str) – Selection criteria for the output.

  • component (str) – Component name.

Returns:

The output folder path.

Return type:

Path

init_dataset(dataset_properties: DatasetConfig)[source]

Dataset-specific IO initialization inside the main dataset loop.

Parameters:

dataset_properties (DatasetProperties) – Properties for the specific dataset.

save_npz(path: Path, **arrays)[source]

Save arrays to a compressed NPZ file.

save_summaries_to_csv(path: Path, data: Dict[str, Any])[source]

Save a summary dict to a CSV file.