Skip to content

Commit

Permalink
FIX: include num_mel_bins in hashdict
Browse files Browse the repository at this point in the history
  • Loading branch information
femke-sintef committed Jan 11, 2024
1 parent d305512 commit ff311e7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion data_utils/DCASEfewshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ def preprocess_df(df):
"frame_length": frame_length,
"tensor_length": tensor_length,
"set_type": set_type,
"overlap": overlap
"overlap": overlap,
"num_mel_bins": num_mel_bins
}
if resample:
my_hash_dict["target_fs"] = target_fs
Expand Down
5 changes: 4 additions & 1 deletion datamodules/DCASEDataModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def __init__(
n_way: int = 5,
n_subsample: int = 1,
overlap: float = 0.5,
num_mel_bins: int = 128,

**kwargs,
):
Expand All @@ -121,6 +122,7 @@ def __init__(
self.n_way = n_way
self.n_subsample = n_subsample
self.overlap = overlap
self.num_mel_bins = num_mel_bins
self.setup()

def setup(self, stage=None):
Expand All @@ -132,7 +134,8 @@ def setup(self, stage=None):
"frame_length": self.frame_length,
"tensor_length": self.tensor_length,
"set_type": self.set_type,
"overlap": self.overlap
"overlap": self.overlap,
"num_mel_bins": self.num_mel_bins,
}
if self.resample:
my_hash_dict["target_fs"] = self.target_fs
Expand Down
2 changes: 2 additions & 0 deletions datamodules/TestDCASEDataModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(
n_query: int = 10,
n_way: int = 2,
n_subsample: int = 1,
num_mel_bins: int = 128,
**kwargs
):
super().__init__(**kwargs)
Expand All @@ -118,6 +119,7 @@ def __init__(
self.n_query = n_query
self.n_way = n_way
self.n_subsample = n_subsample
self.num_mel_bins = num_mel_bins
self.setup()

def setup(self, stage=None):
Expand Down
3 changes: 2 additions & 1 deletion evaluate/evaluateDCASE.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ def write_wav(
"frame_length": cfg["data"]["frame_length"],
"tensor_length": cfg["data"]["tensor_length"],
"set_type": cfg["data"]["set_type"],
"overlap": cfg["data"]["overlap"]
"overlap": cfg["data"]["overlap"],
"num_mel_bins": cfg["data"]["num_mel_bins"]
}
if cfg["data"]["resample"]:
my_hash_dict["target_fs"] = cfg["data"]["target_fs"]
Expand Down

0 comments on commit ff311e7

Please sign in to comment.