εar-VAE: High Fidelity Music Reconstruction Model
18
10 commits
5 linked in READMEs
updated Aug 21, 2026
[Demo Page] - [Codes] - [Paper]
This repository contains the official inference code for εar-VAE, aa 44.1 kHz music signal reconstruction model that rethinks and optimizes VAE training for audio. It targets two common weaknesses in existing open-source VAEs—phase accuracy and stereophonic spatial representation—by aligning objectives with auditory perception and introducing phase-aware training. Experiments show substantial improvements across diverse metrics, with particular strength in high-frequency harmonics and spatial characteristics.
🔥2026-08-21 Update🔥: Now we have the brand new εar-VAE2, feel free to check it [Here!]. ⭐2025-12-10 Update⭐: a new model weight works in 48kHz sample rate, same-level vocal performance with better stereophonic energy reconstruction.
Why εar-VAE:
Follow these steps to set up the environment and install the necessary dependencies.
Clone the repository:
git clone https://github.com/Eps-Acoustic-Revolution-Lab/EAR_VAE.git
cd EAR_VAE
Create and activate a conda environment:
conda create -n ear_vae python=3.8
conda activate ear_vae
Run the installation script:
This script will install the remaining dependencies.
bash install_requirements.sh
This will install:
descript-audio-codecalias-free-torchffmpeg < 7 (via conda)Download the model weight:
The quickest way is to pull the whole repository (config + both checkpoints) from Hugging Face:
huggingface-cli download earlab/EAR_VAE --local-dir .
To fetch a single variant programmatically, read the repository manifest at
config.json and resolve the paths it declares:
import json
from huggingface_hub import hf_hub_download
REPO_ID = "earlab/EAR_VAE"
# config.json is the repo manifest: it lists every available variant
with open(hf_hub_download(REPO_ID, "config.json")) as f:
manifest = json.load(f)
# "ear_vae_v2_48k" (default) or "ear_vae_44k"
variant = manifest["variants"][manifest["default_variant"]]
config_path = hf_hub_download(REPO_ID, variant["config"])
ckpt_path = hf_hub_download(REPO_ID, variant["weights"])
print(config_path, ckpt_path)
| Variant | Sample rate | Compression | Weights |
|---|---|---|---|
ear_vae_44k | 44.1 kHz | 1024× | pretrained_weight/ear_vae_44k.pyt |
ear_vae_v2_48k | 48 kHz | 960× | pretrained_weight/ear_vae_v2_48k.pyt |
The inference.py script is used to process audio files from an input directory and save the reconstructed audio to an output directory.
You can run the inference with the following command:
python inference.py --indir <input_directory> --outdir <output_directory> --model_path <path_to_model> --device <device>
--indir: (Optional) Path to the input directory containing audio files. Default: ./data.--outdir: (Optional) Path to the output directory where reconstructed audio will be saved. Default: ./results.--model_path: (Optional) Path to the pretrained model weights (.pyt file). Default: ./pretrained_weight/ear_vae_44k.pyt.--device: (Optional) The device to run the model on (e.g., cuda:0 or cpu). Defaults to cuda:0 if available, otherwise cpu.Place your input audio files (e.g., .wav, .mp3) into the data/ directory.
Run the inference script:
python inference.py
This will use the default paths. The reconstructed audio files will be saved in the results/ directory.
.
├── README.md # This file
├── config.json # Repository manifest: variant -> config/weights paths
├── config/ # Per-variant model configurations
│ ├── model_config.json # ear_vae_44k (44.1 kHz, 1024x)
│ └── ear_vae_v2.json # ear_vae_v2_48k (48 kHz, 960x)
├── data/ # Default directory for input audio files
├── eval/ # Scripts for model evaluation
│ ├── eval_compare_matrix.py
│ ├── install_requirements.sh
│ └── README.md
├── inference.py # Main script for running audio reconstruction
├── install_requirements.sh # Installation script for dependencies
├── model/ # Contains the model architecture code
│ ├── autoencoders.py
│ ├── ear_vae.py
│ └── transformer.py
├── pretrained_weight/ # Directory for pretrained model weights
│ ├── ear_vae_44k.pyt
│ └── ear_vae_v2_48k.pyt
The model is a Variational Autoencoder with a Generative Adversarial Network (VAE-GAN) structure.
This architecture allows for efficient and high-quality audio reconstruction.
The eval/ directory contains scripts to evaluate the model's reconstruction performance using objective metrics.
Install Dependencies: The evaluation script has its own set of dependencies. Install them by running the script in the eval directory:
bash eval/install_requirements.sh
This will install libraries such as auraloss.
FFmpeg: The script uses ffmpeg for loudness analysis. Make sure ffmpeg is installed and available in your system's PATH. You can install it via conda:
conda install -c conda-forge 'ffmpeg<7'
The eval_compare_matrix.py script compares the reconstructed audio with the original ground truth files and computes various metrics.
For more details on the evaluation metrics and options, refer to the eval/README.md file.
This project builds upon the work of several open-source projects. We would like to extend our special thanks to:
Their contributions have been invaluable to the development of εar-VAE.
10 commits
εar-VAE: High Fidelity Music Reconstruction Model
18
10 commits
5 linked in READMEs
updated Aug 21, 2026
[Demo Page] - [Codes] - [Paper]
This repository contains the official inference code for εar-VAE, aa 44.1 kHz music signal reconstruction model that rethinks and optimizes VAE training for audio. It targets two common weaknesses in existing open-source VAEs—phase accuracy and stereophonic spatial representation—by aligning objectives with auditory perception and introducing phase-aware training. Experiments show substantial improvements across diverse metrics, with particular strength in high-frequency harmonics and spatial characteristics.
🔥2026-08-21 Update🔥: Now we have the brand new εar-VAE2, feel free to check it [Here!]. ⭐2025-12-10 Update⭐: a new model weight works in 48kHz sample rate, same-level vocal performance with better stereophonic energy reconstruction.
Why εar-VAE:
Follow these steps to set up the environment and install the necessary dependencies.
Clone the repository:
git clone https://github.com/Eps-Acoustic-Revolution-Lab/EAR_VAE.git
cd EAR_VAE
Create and activate a conda environment:
conda create -n ear_vae python=3.8
conda activate ear_vae
Run the installation script:
This script will install the remaining dependencies.
bash install_requirements.sh
This will install:
descript-audio-codecalias-free-torchffmpeg < 7 (via conda)Download the model weight:
The quickest way is to pull the whole repository (config + both checkpoints) from Hugging Face:
huggingface-cli download earlab/EAR_VAE --local-dir .
To fetch a single variant programmatically, read the repository manifest at
config.json and resolve the paths it declares:
import json
from huggingface_hub import hf_hub_download
REPO_ID = "earlab/EAR_VAE"
# config.json is the repo manifest: it lists every available variant
with open(hf_hub_download(REPO_ID, "config.json")) as f:
manifest = json.load(f)
# "ear_vae_v2_48k" (default) or "ear_vae_44k"
variant = manifest["variants"][manifest["default_variant"]]
config_path = hf_hub_download(REPO_ID, variant["config"])
ckpt_path = hf_hub_download(REPO_ID, variant["weights"])
print(config_path, ckpt_path)
| Variant | Sample rate | Compression | Weights |
|---|---|---|---|
ear_vae_44k | 44.1 kHz | 1024× | pretrained_weight/ear_vae_44k.pyt |
ear_vae_v2_48k | 48 kHz | 960× | pretrained_weight/ear_vae_v2_48k.pyt |
The inference.py script is used to process audio files from an input directory and save the reconstructed audio to an output directory.
You can run the inference with the following command:
python inference.py --indir <input_directory> --outdir <output_directory> --model_path <path_to_model> --device <device>
--indir: (Optional) Path to the input directory containing audio files. Default: ./data.--outdir: (Optional) Path to the output directory where reconstructed audio will be saved. Default: ./results.--model_path: (Optional) Path to the pretrained model weights (.pyt file). Default: ./pretrained_weight/ear_vae_44k.pyt.--device: (Optional) The device to run the model on (e.g., cuda:0 or cpu). Defaults to cuda:0 if available, otherwise cpu.Place your input audio files (e.g., .wav, .mp3) into the data/ directory.
Run the inference script:
python inference.py
This will use the default paths. The reconstructed audio files will be saved in the results/ directory.
.
├── README.md # This file
├── config.json # Repository manifest: variant -> config/weights paths
├── config/ # Per-variant model configurations
│ ├── model_config.json # ear_vae_44k (44.1 kHz, 1024x)
│ └── ear_vae_v2.json # ear_vae_v2_48k (48 kHz, 960x)
├── data/ # Default directory for input audio files
├── eval/ # Scripts for model evaluation
│ ├── eval_compare_matrix.py
│ ├── install_requirements.sh
│ └── README.md
├── inference.py # Main script for running audio reconstruction
├── install_requirements.sh # Installation script for dependencies
├── model/ # Contains the model architecture code
│ ├── autoencoders.py
│ ├── ear_vae.py
│ └── transformer.py
├── pretrained_weight/ # Directory for pretrained model weights
│ ├── ear_vae_44k.pyt
│ └── ear_vae_v2_48k.pyt
The model is a Variational Autoencoder with a Generative Adversarial Network (VAE-GAN) structure.
This architecture allows for efficient and high-quality audio reconstruction.
The eval/ directory contains scripts to evaluate the model's reconstruction performance using objective metrics.
Install Dependencies: The evaluation script has its own set of dependencies. Install them by running the script in the eval directory:
bash eval/install_requirements.sh
This will install libraries such as auraloss.
FFmpeg: The script uses ffmpeg for loudness analysis. Make sure ffmpeg is installed and available in your system's PATH. You can install it via conda:
conda install -c conda-forge 'ffmpeg<7'
The eval_compare_matrix.py script compares the reconstructed audio with the original ground truth files and computes various metrics.
For more details on the evaluation metrics and options, refer to the eval/README.md file.
This project builds upon the work of several open-source projects. We would like to extend our special thanks to:
Their contributions have been invaluable to the development of εar-VAE.
10 commits