Skip to content

Commit

Permalink
[update] update readme and add cli usage for the dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
Jourdelune committed May 27, 2024
1 parent d139a27 commit 0752da0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# Whisper-lyric

Codebase to finetune whisper for music transcription.

## Installation

To install the required dependencies, run the following command:

```bash
pip install -r requirements.txt
```

## Dataset download

To download the dataset, run the following command:

```bash
python download_dataset.py --num_images 1000
```

The dataset will be downloaded to the `data` directory.
The format of the dataset is as follows:

```
dataset
├── audio
│ ├── 0.wav
│ ├── 1.wav
│ ├── ...
└── lyrics
├── 0.txt
├── 1.txt
├── ...
```

where `0.wav` corresponds to the audio file and `0.txt` corresponds to the lyrics transcription of the audio file.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
3 changes: 2 additions & 1 deletion dataset/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import orjson
import requests as r


_BASE_URL = (
"https://firestore.googleapis.com/google.firestore.v1.Firestore/Listen/channel"
)
Expand Down Expand Up @@ -169,6 +168,8 @@ def _construct_ds(self, audio_data: dict) -> None:
with open(f"./dataset/audio/{nbm_file}.ogg", "wb") as file:
file.write(resp.content)

print(f"Downloaded {nbm_file} songs", end="\r")

def download(self, nb_element: int = 10) -> None:
"""Method to download the data
Expand Down
15 changes: 15 additions & 0 deletions dataset_builder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import argparse

from dataset.build import SonautoAPI


parser = argparse.ArgumentParser(
description="Download images from Sonauto dataset",
)
parser.add_argument("--num_images", type=int, default=10)
parser.add_argument("--clean", type=bool, default=True)

args = parser.parse_args()

api = SonautoAPI(clean=args.clean)
api.download(args.num_images)

0 comments on commit 0752da0

Please sign in to comment.