Spaces:
Running
on
Zero
Running
on
Zero
Upload 2 files
Browse files- app.py +6 -2
- dataset.py +1 -1
app.py
CHANGED
@@ -103,8 +103,12 @@ def detect_on_gpu(dataset):
|
|
103 |
|
104 |
# 修改音频伪造检测主函数
|
105 |
def audio_deepfake_detection(demonstrations, query_audio_path):
|
106 |
-
demonstration_paths = [
|
107 |
-
demonstration_labels = [
|
|
|
|
|
|
|
|
|
108 |
if len(demonstration_paths) != len(demonstration_labels):
|
109 |
demonstration_labels = demonstration_labels[:len(demonstration_paths)]
|
110 |
|
|
|
103 |
|
104 |
# 修改音频伪造检测主函数
|
105 |
def audio_deepfake_detection(demonstrations, query_audio_path):
|
106 |
+
demonstration_paths = []
|
107 |
+
demonstration_labels = []
|
108 |
+
for demonstration in demonstrations:
|
109 |
+
if demonstration[0] is not None:
|
110 |
+
demonstration_paths.append(demonstration[0])
|
111 |
+
demonstration_labels.append(demonstration[1])
|
112 |
if len(demonstration_paths) != len(demonstration_labels):
|
113 |
demonstration_labels = demonstration_labels[:len(demonstration_paths)]
|
114 |
|
dataset.py
CHANGED
@@ -6,7 +6,7 @@ import librosa
|
|
6 |
import numpy as np
|
7 |
|
8 |
class DemoDataset(Dataset):
|
9 |
-
def __init__(self, demonstration_paths, demonstration_labels, query_path, sample_rate=16000):
|
10 |
self.sample_rate = sample_rate
|
11 |
self.query_path = query_path
|
12 |
|
|
|
6 |
import numpy as np
|
7 |
|
8 |
class DemoDataset(Dataset):
|
9 |
+
def __init__(self, demonstration_paths=[], demonstration_labels=[], query_path="", sample_rate=16000):
|
10 |
self.sample_rate = sample_rate
|
11 |
self.query_path = query_path
|
12 |
|