Skip to content
Snippets Groups Projects
Commit b9a43533 authored by Paul Best's avatar Paul Best
Browse files

pesto ft in run_all

parent 27572273
No related branches found
No related tags found
No related merge requests found
......@@ -93,15 +93,12 @@ for specie in species if args.specie is None else args.specie.split(' '):
out.loc[mask, 'tcrepe_ftsp_f0'], out.loc[mask, 'tcrepe_ftsp_conf'] = mir_eval.melody.resample_melody_series(time, f0, confidence, out[mask].time)
out.tcrepe_ftsp_f0 *= downsample
<<<<<<< HEAD
=======
if not 'tcrepe_ftoth_f0' in out.columns and tcrepe_ftoth_model: # torch crepe finetuned on other species than the target
time, f0, confidence = run_tcrepe(tcrepe_ftoth_model, sig, fs, dt)
mask = ((out.time > time[0])&(out.time < time[-1]))
out.loc[mask, 'tcrepe_ftoth_f0'], out.loc[mask, 'tcrepe_ftoth_conf'] = mir_eval.melody.resample_melody_series(time, f0, confidence, out[mask].time)
out.tcrepe_ftsp_f0 *= downsample
>>>>>>> 9c4e6ee4bbcefd87a8410d7f08001a21cc25b753
if not 'crepe_f0' in out.columns: # CREPE
time, f0, confidence, activation = crepe.predict(sig, fs, step_size=int(dt*1e3), center=False, verbose=0) # step_size in ms
out['crepe_f0'], out['crepe_conf'] = mir_eval.melody.resample_melody_series(time, f0, confidence, out.time)
......@@ -122,7 +119,6 @@ for specie in species if args.specie is None else args.specie.split(' '):
out.pesto_f0 *= downsample
except Exception as inst:
out['pesto_f0'], out['pesto_conf'] = None, None
<<<<<<< HEAD
if not 'pesto_ftsp_f0' in out.columns and os.path.isfile(f'pesto_ft/{specie}.pth'): # pesto finetuned
try:
......@@ -131,9 +127,6 @@ for specie in species if args.specie is None else args.specie.split(' '):
out.pesto_ft_f0 *= downsample
except Exception as inst:
out['pesto_ft_f0'], out['pesto_ft_conf'] = None, None
=======
# print('pesto failed with '+fn, inst)
>>>>>>> 9c4e6ee4bbcefd87a8410d7f08001a21cc25b753
out.annot *= downsample
out.time /= downsample
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment