-
Notifications
You must be signed in to change notification settings - Fork 6
Add documentation #3
Copy link
Copy link
Open
Description
- Might be obvious but this requires NVIDIA CUDA Toolkit even if you running on the CPU:
sudo apt install nvidia-cuda-toolkit
-
It doesn't say in the README.txt, but the output score is 0.0 to 1.0 where 0.0 is bad and 1.0 is good.
-
Running
run.pywill create an average score for all files in the provided folder.
If you want results for each file:
# Evaluate and print PAM score for each file
results = {}
for files, audios, sample_index in tqdm(dataloader):
pam_score, pam_segment_score = pam.evaluate(audios, sample_index)
for file, score in zip(files, pam_score):
results[file] = score # Store per-file PAM score
# Sort results by filename
sorted_results = dict(sorted(results.items()))
# Print sorted results
print("\nPAM Scores (Sorted by Filename):")
for file, score in sorted_results.items():
print(f"{file}: {round(score, 3)}")
# Identify best and worst 3 files
sorted_by_score = sorted(results.items(), key=lambda x: x[1]) # Sort by score
worst_files = sorted_by_score[:3] # Get lowest 3 scores
best_files = sorted_by_score[-3:] # Get highest 3 scores
# Print best and worst files
print("\nTop 3 Best Files:")
for file, score in best_files:
print(f"{file}: {round(score, 3)}")
print("\nTop 3 Worst Files:")
for file, score in reversed(worst_files):
print(f"{file}: {round(score, 3)}")
# Compute and print overall score
overall_score = round(sum(results.values()) / len(results), 3) if results else 0
print(f"\nOverall PAM Score: {overall_score}")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels