How lyphucthanh1010/advance_dsp works
API and Web Server Layer
• The central entry point is the Flask application (app.py). This layer exposes endpoints such as "/predict" and "/predict_from_youtube".
• Routing and controller logic and how these endpoints call into internal modules.
Audio Preprocessing / Feature Extraction Layer
• Key modules here include:
– prepare.py and prepare_real.py: likely used for normalizing or pre-processing incoming audio (either local file or downloaded YouTube audio).
– segment.py and model_test.py: used to segment long audio files into portions for processing.
– get_chromaprint_func.py: extracts audio fingerprints (chromaprint) to generate features that will be fed to the model.
Model Inference Engine
• The model component is handled by model.py (and its test variants) and uses a pre-trained Keras model (referred to as model.pkl in the README and model.zip in the file tree).
• That the processed audio features are then sent to the model inference component, where the prediction of copyright violation is generated.
Data and Resource Storage
• The project contains two primary data directories:
– “dataset” which holds JSON files representing audio features for training or reference.
– “datasetreal” which is used for testing.
• Additionally, configuration files such as requirements.txt and scripts like fill_commit.sh provide supportive resources.
Utilities and Task Modules
• Files like repository.py and task.py are likely used for modularizing tasks such as data access and background processing.
• A module “repository” that encapsulates data read/write operations, showing it interacts with the preprocessing or model layers as needed.
External Integrations
• An endpoint for YouTube input is available (/predict_from_youtube), so show an external component (the YouTube service) that the API interacts with to fetch audio if needed.