Upload primary_doverlap.py
Browse files- primary_doverlap.py +25 -0
primary_doverlap.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import subprocess
|
| 3 |
+
import dover_lap
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
rttm_conf_dir = '' # path to the seg_CONF model output (RTTM file)
|
| 8 |
+
|
| 9 |
+
rttm_fa_dir = '' # path to the seg_FA model output (RTTM file)
|
| 10 |
+
|
| 11 |
+
rttm_miss_dir = '' # path to the seg_MISS model output (RTTM file)
|
| 12 |
+
|
| 13 |
+
rttm_output_dir = '' # path to DOVER-Lap output (RTTM file)
|
| 14 |
+
|
| 15 |
+
if not os.path.exists(rttm_output_dir):
|
| 16 |
+
os.makedirs(rttm_output_dir)
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
bashCommand_doverlap = "dover-lap" + " " + rttm_output_dir + " " + rttm_conf_dir + " " + rttm_fa_dir + " " + rttm_miss_dir
|
| 20 |
+
|
| 21 |
+
weights = " " + "--weight-type custom --custom-weight '[0.37,0.26,0.37]'" # custom weights based on the RTVE database
|
| 22 |
+
|
| 23 |
+
bashCommand = bashCommand_doverlap + weights
|
| 24 |
+
|
| 25 |
+
subprocess.run(bashCommand, shell=True, capture_output=True)
|