Skip to content

Fix 1 error and 1 typo #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -78,15 +78,15 @@ 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

Split the processed data into training, validation and test sets.

```sh
python split.py -d sod
python mmt/split.py -d sod
```

## Preprocessed Datasets
Expand Down
4 changes: 2 additions & 2 deletions mmt/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion mmt/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down