test
Browse files- vc_infer_pipeline.py +5 -2
vc_infer_pipeline.py
CHANGED
|
@@ -12,6 +12,7 @@ now_dir = os.getcwd()
|
|
| 12 |
sys.path.append(now_dir)
|
| 13 |
|
| 14 |
bh, ah = signal.butter(N=5, Wn=48, btype="high", fs=16000)
|
|
|
|
| 15 |
|
| 16 |
input_audio_path2wav = {}
|
| 17 |
|
|
@@ -377,6 +378,7 @@ class VC(object):
|
|
| 377 |
version,
|
| 378 |
protect,
|
| 379 |
): # ,file_index,file_big_npy
|
|
|
|
| 380 |
feats = torch.from_numpy(audio0)
|
| 381 |
if self.is_half:
|
| 382 |
feats = feats.half()
|
|
@@ -407,9 +409,10 @@ class VC(object):
|
|
| 407 |
npy = feats[0].cpu().numpy()
|
| 408 |
if self.is_half:
|
| 409 |
npy = npy.astype("float32")
|
| 410 |
-
new_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()]
|
|
|
|
| 12 |
sys.path.append(now_dir)
|
| 13 |
|
| 14 |
bh, ah = signal.butter(N=5, Wn=48, btype="high", fs=16000)
|
| 15 |
+
new_npy = None
|
| 16 |
|
| 17 |
input_audio_path2wav = {}
|
| 18 |
|
|
|
|
| 378 |
version,
|
| 379 |
protect,
|
| 380 |
): # ,file_index,file_big_npy
|
| 381 |
+
global new_npy
|
| 382 |
feats = torch.from_numpy(audio0)
|
| 383 |
if self.is_half:
|
| 384 |
feats = feats.half()
|
|
|
|
| 409 |
npy = feats[0].cpu().numpy()
|
| 410 |
if self.is_half:
|
| 411 |
npy = npy.astype("float32")
|
| 412 |
+
# Convert new_npy to a numpy array
|
| 413 |
+
new_npy = npy.astype("float32")
|
| 414 |
# Export the new_npy to a file
|
| 415 |
+
np.save("./logs/new_npy.npy", new_npy)
|
| 416 |
|
| 417 |
# _, I = index.search(npy, 1)
|
| 418 |
# npy = big_npy[I.squeeze()]
|