viqa.utils.export_results¶
- viqa.utils.export_results(metrics, output_path, filename, return_dict=False)[source]¶
Export data to a csv file.
- Parameters:
metrics (list) – List of metrics
output_path (str or os.PathLike) – Output path
filename (str or os.PathLike) – Name of the file
return_dict (bool, optional) – If True, the results are returned as a dictionary. Default is False.
Notes
This function just writes the
score_val
attribute of instanced metrics to a csv file. Therefore, the metrics must have been calculated before exporting and no-reference metrics cannot be distinguished between reference and modified image.Attention
The csv file will be overwritten if it already exists.
Examples
>>> from viqa import export_results, FSIM, PSNR >>> metric1 = FSIM() >>> metric2 = PSNR() >>> metrics = [metric1, metric2] >>> export_results(metrics, "path/to/output", "filename.csv")