David Thomas commited on
Commit
306e9ac
·
1 Parent(s): ae4b76f

change to vc pipeline to generate similarity score

Browse files
Files changed (1) hide show
  1. vc_infer_pipeline.py +4 -1
vc_infer_pipeline.py CHANGED
@@ -387,7 +387,7 @@ class VC(object):
387
  assert feats.dim() == 1, feats.dim()
388
  feats = feats.view(1, -1)
389
  padding_mask = torch.BoolTensor(feats.shape).to(self.device).fill_(False)
390
-
391
  inputs = {
392
  "source": feats.to(self.device),
393
  "padding_mask": padding_mask,
@@ -407,6 +407,9 @@ class VC(object):
407
  npy = feats[0].cpu().numpy()
408
  if self.is_half:
409
  npy = npy.astype("float32")
 
 
 
410
 
411
  # _, I = index.search(npy, 1)
412
  # npy = big_npy[I.squeeze()]
 
387
  assert feats.dim() == 1, feats.dim()
388
  feats = feats.view(1, -1)
389
  padding_mask = torch.BoolTensor(feats.shape).to(self.device).fill_(False)
390
+ new_npy = None
391
  inputs = {
392
  "source": feats.to(self.device),
393
  "padding_mask": padding_mask,
 
407
  npy = feats[0].cpu().numpy()
408
  if self.is_half:
409
  npy = npy.astype("float32")
410
+ new_npy=npy
411
+ # Export the new_npy to a file
412
+ np.save("new_npy.npy", new_npy)
413
 
414
  # _, I = index.search(npy, 1)
415
  # npy = big_npy[I.squeeze()]