import os
import subprocess
import dover_lap



rttm_conf_dir = '' # path to the seg_CONF model output (RTTM file)

rttm_fa_dir = '' # path to the seg_FA model output (RTTM file)

rttm_miss_dir = '' # path to the seg_MISS model output (RTTM file)

rttm_output_dir = '' # path to DOVER-Lap output (RTTM file)

if not os.path.exists(rttm_output_dir):
    os.makedirs(rttm_output_dir)


bashCommand_doverlap = "dover-lap" + " " + rttm_output_dir + " " + rttm_conf_dir + " " + rttm_fa_dir + " " + rttm_miss_dir

weights = " " + "--weight-type custom --custom-weight '[0.37,0.26,0.37]'" # custom weights based on the RTVE database

bashCommand = bashCommand_doverlap + weights

subprocess.run(bashCommand, shell=True, capture_output=True)