Exemplo n.º 1
0
"""
TODO COMPLETE

evaluate precomputed output files
"""

from baseline import parameter
import os
from APRI.compute_metrics import compute_metrics
from APRI.utils import plot_results


# %% PARAMS

preset = 'particle'
params = parameter.get_params(preset)
gt_folder = os.path.join(params['dataset_dir'], 'metadata_dev')  # path to annotations
this_file_path = os.path.dirname(os.path.abspath(__file__))
result_folder_path = os.path.join(this_file_path, params['results_dir'], preset)


# %% PLOT

# Achtung! will plot *all* metadata result files
# res_files = [f for f in os.listdir(result_folder_path) if f != '.DS_Store']
res_files = ['fold1_room1_mix007_ov1.csv',
             'fold2_room1_mix007_ov1.csv',
             'fold3_room1_mix007_ov1.csv',
             # 'fold4_room1_mix007_ov1.csv',
             # 'fold5_room1_mix007_ov1.csv',
             # 'fold6_room1_mix007_ov1.csv',
'''

import os, datetime
from baseline import parameter
from APRI.training_batch_data_augmentation import *
from APRI.training_batch_generate_audio_features import *
from APRI.get_dataframes import *
from APRI.localization_detection import *
import pickle
import soundfile as sf
from APRI.utils import plot_metadata, get_class_name_dict, get_mono_audio_from_event, Event
from baseline.cls_feature_class import create_folder
import time

# Import general parametes
params = parameter.get_params()
dataset_dir = os.path.join(params['dataset_dir'])

# Parameters
mode = 'new'  # new or modify
pipeline = 'Datasets_2020-06-05_22-15'  #if mode is 'modify'
#original_event_dataset='oracle_mono_testing'

extra_events = False
data_augmentation = True
audio_parameters_real = True
audio_parameters_aug = True
audio_parameters_extra = False
creating_dataframe_real = True
creating_dataframe_aug = True
creating_dataframe_extra = False