Commit 3e8f0d0b authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ci/split-output-files-b4-comparison' into kiene/tmp-branch-for-ltv-split-testing

parents 08968f13 87691838
Loading
Loading
Loading
Loading
+18 −14
Original line number Diff line number Diff line
@@ -4,11 +4,11 @@ from typing import List
from create_report_pages import SUBPAGE_TMPL_CSS, FORMATS


TITLE = {
TITLE_4_MEASURE = {
    "MLD": "Maximum MLD across channels",
    "DIFF": "Maximim absolute difference across channels",
    "SSNR": "Minimum SSNR across channels",
    "ODG": "Minimum PEAQ ODG across channels",
    "MAX_ABS_DIFF": "Maximim absolute difference across channels",
    "MIN_SSNR": "Minimum SSNR across channels",
    "MIN_ODG": "Minimum PEAQ ODG across channels",
    "DELTA_ODG": "PEAQ ODG using binauralized input and output",
}

@@ -28,18 +28,21 @@ def create_summary_page(
    measures: List[str],
    image_dir: str,
):
    images = "<hr>"
    html = "<hr>"
    for m in measures:
        images += (
            f"<h2>{TITLE[m]}</h2>\n"
            + " ".join([f"<img src={image_dir}/summary_{m}_{x}.png>" for x in FORMATS])
            + f'\n<br><a href="{image_dir}/summary_{m}.csv">summary_{m}.csv</a><hr>\n\n'
        image_filename_tmpl = "histogram_{measure}_{format}.png"
        image_html = " ".join(
            [
                f"<img src={image_dir}/{image_filename_tmpl.format(measure=m, format=f)}>"
                for f in FORMATS
            ]
        )
        html += f"<h2>{TITLE_4_MEASURE[m]}</h2>\n" + image_html

    new_summary_page = SUBPAGE_TMPL_CSS + SUMMARY_PAGE_TMPL_HTML.format(
        id_current=id_current,
        job_name=job_name,
        images=images,
        images=html,
    )
    with open(html_out, "w") as f:
        f.write(new_summary_page)
@@ -54,14 +57,15 @@ if __name__ == "__main__":
    parser.add_argument(
        "--measures",
        nargs="+",
        help=f"List of measures to include in summary. Allowed values: {' '.join(TITLE.keys())}",
        default=["MLD", "DIFF", "SSNR", "ODG"],
        help=f"List of measures to include in summary. Allowed values: {' '.join(TITLE_4_MEASURE.keys())}",
        # exclude DELTA_ODG here
        default=list(TITLE_4_MEASURE.keys())[:-1],
    )
    args = parser.parse_args()

    if not all([m in TITLE for m in args.measures]):
    if not all([m in TITLE_4_MEASURE for m in args.measures]):
        raise ValueError(
            f"Invalid list of measures: {args.measures}, expected one of {' '.join(TITLE.keys())}"
            f"Invalid list of measures: {args.measures}, expected one of {' '.join(TITLE_4_MEASURE.keys())}"
        )

    create_summary_page(
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ def create_histograms(
                image_file = f"histogram_{measure}_{fmt}.png"
                image_path = output_folder.joinpath(image_file)
                plt.savefig(image_path)
                plt.close(fig)

    if display_only:
        plt.show()
+2 −1
Original line number Diff line number Diff line
@@ -1296,6 +1296,7 @@ IVAS_ENC_FORMATS = {
    "mc": "Multichannel",
    "stereo_dmx_evs": "Stereo DMX EVS",
}
# NOTE: the blanks at start and end are important to prevent e.g. "-ism_masa" matching on "-ism" only
PATTERN_IVAS_ENC_FORMAT = re.compile(r"-( " + r"|".join(IVAS_ENC_FORMATS.keys()) + ") ")