Spaces:
Running on Zero
Running on Zero
Download src/create_dev_labels.py from iAmNewUserOkay/audio-deepfake-detector: direct link, hf CLI and curl.
- Browser
- Download file 506 Bytes
-
https://huggingface.co/spaces/iAmNewUserOkay/audio-deepfake-detector/resolve/main/src/create_dev_labels.py
- Command line
-
hf download hf://spaces/iAmNewUserOkay/audio-deepfake-detector/src/create_dev_labels.py
-
curl -L -o create_dev_labels.py https://huggingface.co/spaces/iAmNewUserOkay/audio-deepfake-detector/resolve/main/src/create_dev_labels.py
506 Bytes
| import pandas as pd | |
| protocol_file = "dataset/LA/ASVspoof2019_LA_cm_protocols/ASVspoof2019.LA.cm.dev.trl.txt" | |
| rows = [] | |
| with open(protocol_file, "r") as f: | |
| for line in f: | |
| parts = line.strip().split() | |
| filename = parts[1] + ".flac" | |
| label = parts[-1] | |
| rows.append([filename, label]) | |
| df = pd.DataFrame(rows, columns=["file_name", "label"]) | |
| print(df.head()) | |
| df.to_csv("dataset/dev_labels.csv", index=False) | |
| print("\nSaved Successfully!") | |
| print("Total Files:", len(df)) |