Skip to content

Add documentation #3

Description

@coezbek
  1. Might be obvious but this requires NVIDIA CUDA Toolkit even if you running on the CPU:
sudo apt install nvidia-cuda-toolkit
  1. 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.

  2. Running run.py will 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}")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions