f0 hybrid implementation: fixed usage with harvest by killing first frame of harvest f0 nparray

This commit is contained in:
Mangio621
2023-05-20 18:05:14 +10:00
parent b554340c0d
commit 415f6525e6
2 changed files with 5 additions and 1 deletions

View File

@@ -1345,7 +1345,7 @@ def print_page_details():
print(" arg 4) feature index file path: logs/mi-test/added_IVF3042_Flat_nprobe_1.index")
print(" arg 5) speaker id: 0")
print(" arg 6) transposition: 0")
print(" arg 7) f0 method: harvest (pm, harvest, crepe, crepe-tiny)")
print(" arg 7) f0 method: harvest (pm, harvest, crepe, crepe-tiny, hybrid[x,x,x,x])")
print(" arg 8) crepe hop length: 128")
print(" arg 9) harvest median filter radius: 3 (0-7)")
print(" arg 10) post resample rate: 0")

View File

@@ -170,9 +170,13 @@ class VC(object):
f0 = cache_harvest_f0(input_audio_path, self.sr, f0_max, f0_min, 10)
if filter_radius > 2:
f0 = signal.medfilt(f0, 3)
f0 = f0[1:] # Get rid of first frame.
# Push method to the stack
f0_computation_stack.append(f0)
for fc in f0_computation_stack:
print(len(fc))
print("Calculating hybrid median f0 from the stack of: %s" % str(methods))
f0_median_hybrid = np.nanmedian(f0_computation_stack, axis=0)
return f0_median_hybrid