Skip to content

Conversation

@google-labs-jules
Copy link

This PR adds functionality to generate perceptual hashes (pHash) from MFCC features of audio segments corresponding to detected chords.

Changes:

  1. Database: Added app/database.py to handle SQLite connection and chord_fingerprints table creation. It provides save_phash_chord_pair function and a context manager for DB transactions.
  2. Tasks: Modified e2e_base_ready_task in app/tasks/chord_tasks.py to:
    • Load the separated audio file using librosa.
    • Iterate through detected chord time windows.
    • Extract the corresponding audio segment.
    • Compute MFCC features using librosa.
    • Convert MFCC to an image and compute pHash using ImageHash.
    • Persist the pHash and chord symbol to the SQLite database.
  3. Dependencies: Added ImageHash and Pillow to requirements.txt.

This feature allows for fingerprinting of chord audio segments which can be used for downstream tasks like retrieval or comparison.


PR created automatically by Jules for task 3374808773528310123 started by @Party4Bread

- Implement `app/database.py` for storing pHash and chord symbol pairs in SQLite.
- Update `app/tasks/chord_tasks.py` in `e2e_base_ready_task` to compute MFCC and pHash for detected chord segments using `librosa` and `ImageHash`.
- Add `ImageHash` and `Pillow` to `requirements.txt`.
- Save the pHash-chord pair to the database.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

- Introduce `app/database.py` to manage SQLite database for caching and fingerprints.
- Update `app/tasks/chord_tasks.py` to:
    - Compute pHash of input audio files to cache full pipeline results.
    - Compute pHash of individual chord segments to build a chord fingerprint database.
- Update `app/schemas.py` to allow optional URLs for cached results.
- Add `ImageHash` and `Pillow` to `requirements.txt`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant