From a113578d3ec54ff714d538c7e9c3187aefe45583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Paiva?= Date: Thu, 23 Jul 2026 01:27:21 +0000 Subject: [PATCH 1/6] Update Requirements --- app/requirements.txt | 6 +++--- requirements.txt | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/requirements.txt b/app/requirements.txt index 2de9f2d..b756a59 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,5 +1,5 @@ -tensorflow-cpu==2.14.0 -gradio==6.7.0 +tensorflow==2.14.0 +gradio==6.20.0 typing-extensions==4.15 mido==1.3.3 pumpp==0.6.0 @@ -9,6 +9,6 @@ pandas==2.2.2 hdf5plugin==4.4.0 h5py==3.9.0 tables==3.9.2 -soundfile==0.13.1 +soundfile==0.14.0 librosa==0.11.0 matplotlib==3.8.0 diff --git a/requirements.txt b/requirements.txt index 31f7c10..ab6aec2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,13 +13,13 @@ seaborn==0.13.2 jupyterlab==4.5.10 ipywidgets==8.1.1 librosa==0.11.0 -mir_eval==0.7 -ray==2.54.0 +mir_eval==0.8.2 +ray==2.56.1 tensorflow==2.14.0 tensorboard==2.14.0 scikit-learn==1.5.1 -gradio==6.7.0 -pyarrow==17.0.0 +gradio==6.20.0 +pyarrow==25.0.0 typing-extensions==4.8.0 pydantic==2.8.2 pydantic-core==2.20.1 @@ -31,7 +31,7 @@ muda==0.4.1 pescador==3.0.0 pumpp==0.6.0 pysoundfile==0.9.0.post1 -soundfile==0.13.1, +soundfile==0.14.0, sox==1.5.0 samplerate==0.2.1 resampy==0.4.3 From bcd23e5a13cd0e0c1bda7a5e03f7966d4fcf2a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Paiva?= Date: Thu, 23 Jul 2026 01:29:53 +0000 Subject: [PATCH 2/6] Update HF app configs --- app/README.md | 4 ++-- app/pyproject.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/README.md b/app/README.md index b02d932..c5759c3 100644 --- a/app/README.md +++ b/app/README.md @@ -4,9 +4,9 @@ emoji: 🐠 colorFrom: yellow colorTo: blue sdk: gradio -sdk_version: 6.7.0 +sdk_version: 6.20.0 app_file: app.py -python_version: 3.11 +python_version: 3.12.12 pinned: true license: cc --- diff --git a/app/pyproject.toml b/app/pyproject.toml index caa95a1..3c560ed 100644 --- a/app/pyproject.toml +++ b/app/pyproject.toml @@ -8,9 +8,9 @@ readme = "README.md" packages = [{include = "Choral_Quartets_F0_Extractor"}] [tool.poetry.dependencies] -python = "^3.11" +python = "^3.12.12" tensorflow-cpu = "^2.14" -gradio = "^6.7" +gradio = "^6.20" typing-extensions = "^4.15" mido = "^1.3.3" pumpp = "^0.6" @@ -20,7 +20,7 @@ pandas = "^2.2" hdf5plugin = "^4.4" h5py = "^3.9" tables = "^3.9" -librosa = "^0.10" +librosa = "^0.11" matplotlib = "^3.8" [build-system] From a981ef07e49bbb19b453e548df741b3f0dfba194 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Paiva?= Date: Thu, 23 Jul 2026 01:39:16 +0000 Subject: [PATCH 3/6] Updates on app to run on ZeroGPU - Attempt #1 --- Dockerfile | 2 +- app/app.py | 19 +++++++++++++------ app/cqfe_utils.py | 3 +++ app/pyproject.toml | 2 +- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8b8319..0b83ce8 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN python -m pip install --upgrade pip && pip install -r requirements.txt && pi RUN rm requirements.txt EXPOSE 8888 EXPOSE 6006 -EXPOSE 7860 +EXPOSE 7860' #ARG UID=10001 #RUN adduser \ diff --git a/app/app.py b/app/app.py index fd5e3c3..1b046b0 100644 --- a/app/app.py +++ b/app/app.py @@ -1,11 +1,18 @@ +import tensorflow as tf import gradio as gr from cqfe_utils import cqfe -cqfe_interface = gr.Interface(fn=cqfe, - inputs=gr.Audio(type='filepath', format='wav', label='Audio Input File'), - outputs=[gr.File(type='filepath', label='F0 Output Files'), - gr.Plot(label='F0 Estimation Plot')], - title="Choral Quartets F0 Extractor (v0.3.0)", - description="An application that uses Multi-Pitch Estimation and Voice Assignment to transform audio files with Choral Quartets recordings into files (CSV, HDF5 and MIDI) containing F0 estimations for each voice (Soprano, Alto, Tenor and Bass). The processing may take a few minutes.") if __name__ == "__main__": + physical_devices = tf.config.list_physical_devices('GPU') + if physical_devices: + tf.config.experimental.set_memory_growth(physical_devices[0], True) + + cqfe_interface = gr.Interface(fn=cqfe, + inputs=gr.Audio(type='filepath', format='wav', label='Audio Input File'), + outputs=[gr.File(type='filepath', label='F0 Output Files'), + gr.Plot(label='F0 Estimation Plot')], + title="Choral Quartets F0 Extractor (v0.4.0)", + description="An application that uses Multi-Pitch Estimation and Voice Assignment to transform audio files with Choral Quartets recordings into files (CSV, HDF5 and MIDI) containing F0 estimations for each voice (Soprano, Alto, Tenor and Bass). The processing may take a few minutes.") + + cqfe_interface.launch(share=True) \ No newline at end of file diff --git a/app/cqfe_utils.py b/app/cqfe_utils.py index bcfbb71..7eb8cb8 100644 --- a/app/cqfe_utils.py +++ b/app/cqfe_utils.py @@ -2,6 +2,7 @@ import math import mido import pumpp +import spaces import librosa import numpy as np import pandas as pd @@ -222,6 +223,7 @@ def compute_pump_features(pump, audio_fpath): ############################################################ +@spaces.GPU(duration=60) def get_mpe_prediction(model, audio_file=None): """Generate output from a model given an input numpy file. Part of this function is part of deepsalience @@ -259,6 +261,7 @@ def get_mpe_prediction(model, audio_file=None): ############################################################ +@spaces.GPU(duration=60) def get_va_prediction(model, f0_matrix): splits = f0_matrix.shape[1]//256 splits_diff = 256 - (f0_matrix.shape[1] - splits * 256) diff --git a/app/pyproject.toml b/app/pyproject.toml index 3c560ed..c6ae06b 100644 --- a/app/pyproject.toml +++ b/app/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Choral-Quartets-F0-Extractor" -version = "0.3.0" +version = "0.4.0" description = "An application that uses Multi-Pitch Estimation and Voice Assignment to transform audio files with Choral Quartets recordings into files (CSV, HDF5 and MIDI) containing F0 estimations for each voice (Soprano, Alto, Tenor and Bass)." authors = ["André Paiva (Xornotor) "] license = "cc" From 5c444c7d6dd90daff5dcc17ceeac0f37756367eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Paiva?= Date: Thu, 23 Jul 2026 01:41:35 +0000 Subject: [PATCH 4/6] Fixing mistype on Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0b83ce8..f8b8319 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN python -m pip install --upgrade pip && pip install -r requirements.txt && pi RUN rm requirements.txt EXPOSE 8888 EXPOSE 6006 -EXPOSE 7860' +EXPOSE 7860 #ARG UID=10001 #RUN adduser \ From 5939f70a244b8029ab40882a1fb03d8ba6e12da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Paiva?= Date: Thu, 23 Jul 2026 01:42:55 +0000 Subject: [PATCH 5/6] Updating requirements for app: adding spaces --- app/pyproject.toml | 1 + app/requirements.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/app/pyproject.toml b/app/pyproject.toml index c6ae06b..fb543b4 100644 --- a/app/pyproject.toml +++ b/app/pyproject.toml @@ -22,6 +22,7 @@ h5py = "^3.9" tables = "^3.9" librosa = "^0.11" matplotlib = "^3.8" +spaces = "^0.51.1" [build-system] requires = ["poetry-core"] diff --git a/app/requirements.txt b/app/requirements.txt index b756a59..2483987 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -12,3 +12,4 @@ tables==3.9.2 soundfile==0.14.0 librosa==0.11.0 matplotlib==3.8.0 +spaces==0.51.1 From a9480edb239f9db26c04a6a7cb8f3b71f3bbe35f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Paiva?= Date: Thu, 23 Jul 2026 01:56:54 +0000 Subject: [PATCH 6/6] Update docker requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ab6aec2..4156efd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ tensorboard==2.14.0 scikit-learn==1.5.1 gradio==6.20.0 pyarrow==25.0.0 -typing-extensions==4.8.0 +typing-extensions==4.15 pydantic==2.8.2 pydantic-core==2.20.1 pillow==12.3.0