From 62168be8e861b6f174f19daa4919cd4a779b6acd Mon Sep 17 00:00:00 2001 From: InabaTatsuro Date: Mon, 20 Nov 2023 18:46:57 +0900 Subject: [PATCH 1/3] Fix missing dot in with_suffix method call --- mmt/extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmt/extract.py b/mmt/extract.py index 110b658..99c9436 100644 --- a/mmt/extract.py +++ b/mmt/extract.py @@ -72,10 +72,10 @@ def extract(name, in_dir, out_dir, resolution): (out_dir / name).parent.mkdir(exist_ok=True) # Save the notes as a CSV file - representation.save_csv_notes((out_dir / name).with_suffix("csv"), notes) + representation.save_csv_notes((out_dir / name).with_suffix(".csv"), notes) # Save the notes as a NPY file - np.save((out_dir / name).with_suffix("npy"), notes) + np.save((out_dir / name).with_suffix(".npy"), notes) return name From c11da7492fcc79ca633dfa6574782f04daa62888 Mon Sep 17 00:00:00 2001 From: InabaTatsuro Date: Mon, 20 Nov 2023 19:14:36 +0900 Subject: [PATCH 2/3] Fix shell scripts --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e5a4884..c9e8acf 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ We also support the following two datasets: Get a list of filenames for each dataset. ```sh -find data/sod/SOD -type f -name *.mid -o -name *.xml | cut -c 14- > data/sod/original-names.txt +find data/sod/SOD -type f -name '*.mid' -o -name '*.xml' | cut -c 14- > data/sod/original-names.txt ``` > Note: Change the number in the cut command for different datasets. @@ -68,7 +68,7 @@ find data/sod/SOD -type f -name *.mid -o -name *.xml | cut -c 14- > data/sod/ori Convert the MIDI and MusicXML files into MusPy files for processing. ```sh -python convert_sod.py +python mmt/convert_sod.py ``` > Note: You may enable multiprocessing with the `-j` option, for example, `python convert_sod.py -j 10` for 10 parallel jobs. @@ -78,7 +78,7 @@ python convert_sod.py Extract a list of notes from the MusPy JSON files. ```sh -python extract.py -d sod +python mmt/extract.py -d sod ``` ### Split training/validation/test sets @@ -86,7 +86,7 @@ python extract.py -d sod Split the processed data into training, validation and test sets. ```sh -python split.py -d sod +python mmt/split.py -d sod ``` ## Preprocessed Datasets From 133c875cfc3022a1ab8c6483f49d80d7f008d80a Mon Sep 17 00:00:00 2001 From: InabaTatsuro Date: Tue, 21 Nov 2023 18:50:04 +0900 Subject: [PATCH 3/3] Fix arguments in mkdir --- mmt/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmt/train.py b/mmt/train.py index 1509939..e222ef9 100644 --- a/mmt/train.py +++ b/mmt/train.py @@ -204,7 +204,7 @@ def main(): args.out_dir = pathlib.Path(f"exp/test_{args.dataset}") # Make sure the output directory exists - args.out_dir.mkdir(exist_ok=True) + args.out_dir.mkdir(parents=True, exist_ok=True) (args.out_dir / "checkpoints").mkdir(exist_ok=True) # Set up the logger