From 5f189b54dba85417279073616a594e4f2d5eb23e Mon Sep 17 00:00:00 2001 From: genisplaja Date: Sat, 7 Dec 2024 11:15:23 +0900 Subject: [PATCH] several fixes and cleaning --- webbook/introduction/compiam.ipynb | 29 ++++++++++++--- webbook/introduction/python.ipynb | 5 --- webbook/resources/exploring-performance.ipynb | 35 ++++++++++++------- .../music-segmentation.ipynb | 28 +++++++-------- 4 files changed, 62 insertions(+), 35 deletions(-) diff --git a/webbook/introduction/compiam.ipynb b/webbook/introduction/compiam.ipynb index 18fe667..0b5430f 100644 --- a/webbook/introduction/compiam.ipynb +++ b/webbook/introduction/compiam.ipynb @@ -231,17 +231,38 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "The ``compiam.load_dataset()`` wrapper allows the user to initialize the dataloader for any dataset included in the list displayed above. Let's take a look at an example." + "The ``compiam.load_dataset()`` wrapper allows the user to initialize the dataloader for any dataset included in the list displayed above. " ] }, { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "remove-output" + ] + }, "outputs": [], "source": [ "## Initializing dataloader for an example dataset\n", - "saraga_carnatic = load_dataset(\"saraga_carnatic\")\n", + "saraga_carnatic = load_dataset(\"saraga_carnatic\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The ``load_dataset()`` wrapper automatically downloads the dataset \"index\", which is used to build the dataloader, locate the dataset files, and identify each entity in the dataset. For more information on the mechanics of the dataset loading, see the [mirdata documentation](https://mirdata.readthedocs.io/en/stable/) and the [dataset walkthrough](datasets) of this tutorial.\n", + "\n", + "Let's now see how the dataset class looks like inside:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "saraga_carnatic" ] }, @@ -441,7 +462,7 @@ "metadata": {}, "source": [ "## The extent of `compiam`\n", - "In the current latest version of `compiam` (v0.3.0), the package includes access to 10 datasets, access to the Carnatic and the Hindustani corpora in Dunya, and a bit more that 10 tools and models to use, covering 9 different tasks. We are aware, *and we are very interested in bringing that into the open*, that the topic of the computational analysis of Indian Art Music, especially on the tools and models side, **is way broader**. The literature includes a vast amount of very interesting and relevant works that, mainly because of the time constraint, are not included in the first release of `compiam`.\n", + "In the current latest version of `compiam` (v0.4.1), the package includes access to 10 datasets, access to the Carnatic and the Hindustani corpora in Dunya, and more that 12 tools and models to use, covering 9 different tasks. We are aware, *and we are very interested in bringing that into the open*, that the topic of the computational analysis of Indian Art Music, especially on the tools and models side, **is way broader**. The literature includes a vast amount of very interesting and relevant works that, mainly because of the time constraint, are not included in the first release of `compiam`.\n", "\n", "However, we have been designing `compiam` so that it evolves as a community-driven initiative, in which anyone can integrate datasts, tools, and models for the computational analysis of Indian Art Music. \n", "\n", diff --git a/webbook/introduction/python.ipynb b/webbook/introduction/python.ipynb index f81e6a0..f8cedda 100644 --- a/webbook/introduction/python.ipynb +++ b/webbook/introduction/python.ipynb @@ -143,11 +143,6 @@ "print(str(datetime.timedelta(seconds=duration)).split(\".\")[0])" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [] - }, { "cell_type": "markdown", "metadata": {}, diff --git a/webbook/resources/exploring-performance.ipynb b/webbook/resources/exploring-performance.ipynb index 2ed0cac..63c2692 100644 --- a/webbook/resources/exploring-performance.ipynb +++ b/webbook/resources/exploring-performance.ipynb @@ -26,23 +26,24 @@ "metadata": {}, "source": [ "## Contents\n", - "1. Import Dependencies and Data\n", - "2. Loading and Visualising Data\n", - " - Multitrack Player\n", - " - Video and Gesture Tracks\n", - "3. Feature Extraction\n", - " - Tonic Identificaton\n", - " - Raga Recognition\n", - " - Source Separation\n", - " - Pitch Extraction\n", - " - Percussion Onset Detection\n", - " - Melodic Pattern Detection " + "1. [Import Dependencies and Data](exploring_import_deps)\n", + "2. [Loading and Visualising Data](exploring_visualising)\n", + " - [Multitrack Player](exploring_player)\n", + " - [Video and Gesture Tracks](exploring_video)\n", + "3. [Feature Extraction](exploring_feature)\n", + " - [Tonic Identificaton](exploring_tonic)\n", + " - [Raga Recognition](exploring_raga)\n", + " - [Music Source Separation](exploring_separation)\n", + " - [Pitch Extraction](exploring_pitch)\n", + " - [Percussion Onset Detection](exploring_onset)\n", + " - [Melodic Pattern Detection](exploring_pattern)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_import_deps)\n", "## 1. Import Dependencies and Data" ] }, @@ -415,6 +416,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_visualising)\n", "## 2. Loading and visualising the data" ] }, @@ -462,6 +464,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_player)\n", "### 1.1 Multitrack player" ] }, @@ -535,6 +538,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_player)\n", "### 1.2 Video and Gesture Tracks" ] }, @@ -755,7 +759,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## 2. Feature Extraction" + "=(exploring_feature)\n", + "## 3. Feature Extraction" ] }, { @@ -781,6 +786,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_tonic)\n", "### 2.1 Tonic Identification" ] }, @@ -911,6 +917,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_raga)\n", "### 2.2 Raga Recognition" ] }, @@ -993,6 +1000,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_separation)\n", "### 2.3 Music Source Separation" ] }, @@ -1227,6 +1235,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_pitch)\n", "### 2.4 Pitch Extraction" ] }, @@ -1763,6 +1772,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_onset)\n", "### 2.5 Percussion onset detection" ] }, @@ -1887,6 +1897,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "=(exploring_pattern)\n", "### 2.6 Melodic pattern discovery" ] }, diff --git a/webbook/structure_analysis/music-segmentation.ipynb b/webbook/structure_analysis/music-segmentation.ipynb index 229174f..457c911 100644 --- a/webbook/structure_analysis/music-segmentation.ipynb +++ b/webbook/structure_analysis/music-segmentation.ipynb @@ -87,7 +87,11 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "tags": [ + "remove-output" + ] + }, "outputs": [], "source": [ "dbs = compiam.load_model(\"structure:dhrupad-bandish-segmentation\")" @@ -141,15 +145,14 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [ - "remove-output" - ] - }, + "metadata": {}, "outputs": [], "source": [ "%pip install spleeter\n", - "%pip install numba --upgrade" + "%pip install numba --upgrade\n", + "%pip install \"keras<3\"\n", + "%pip install \"tensorflow==2.9.0\"\n", + "%pip install \"numpy<2.0.0\"" ] }, { @@ -162,11 +165,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "tags": [ - "remove-output" - ] - }, + "metadata": {}, "outputs": [], "source": [ "!wget https://github.com/deezer/spleeter/releases/download/v1.4.0/2stems.tar.gz" @@ -243,6 +242,7 @@ }, "outputs": [], "source": [ + "import spleeter\n", "from spleeter.separator import Separator\n", "\n", "# Load default 2-stem spleeter separation\n", @@ -353,7 +353,7 @@ "source": [ "dbs.predict_stm(\n", " input_data=os.path.join(\n", - " \"..\", \"audio\", \"59c88c32-0bde-433b-b194-0f65281e5714\", \"vocals.wav\"\n", + " \"..\", \"audio\", \"59c88c32-0bde-433b-b194-0f65281e5714.mp3\"\n", " )\n", ")" ] @@ -378,7 +378,7 @@ "\n", "vocals, sr = librosa.load(\n", " os.path.join(\n", - " \"..\", \"audio\", \"59c88c32-0bde-433b-b194-0f65281e5714\", \"vocals.wav\"\n", + " \"..\", \"audio\", \"59c88c32-0bde-433b-b194-0f65281e5714.mp3\"\n", " ),\n", ")" ]