diff --git a/shell/generate-py.sh b/shell/generate-py.sh new file mode 100755 index 0000000..ab063df --- /dev/null +++ b/shell/generate-py.sh @@ -0,0 +1,18 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# +# Python-based generation +# +# usage: ./generate.sh experiment-name path-to-files decoders model-name sample-length +# example usage: ./generate.sh umtcpc-pretrained-wavenet results/05_05_21/umtcpc_pretrained_wavenet-py "0 1 2" umtcpc 80000 + +#!/usr/bin/env bash + +DATE=`date +%d_%m_%Y` +CODE=src + +python3.7 ${CODE}/data/run_on_files.py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --files $2 --decoders $3 --model-name $4 --sample-len $5 --sample-len 80000 --py + diff --git a/shell/generate.sh b/shell/generate.sh new file mode 100755 index 0000000..059554d --- /dev/null +++ b/shell/generate.sh @@ -0,0 +1,18 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# +# Generate with nvidia wavenet kernels +# +# usage: ./generate.sh experiment-name path-to-files decoders model-name +# example usage: ./generate.sh umtcpc-pretrained-wavenet results/05_05_21/umtcpc_pretrained_wavenet "0 1 2" umtcpc + +#!/usr/bin/env bash + +DATE=`date +%d_%m_%Y` +CODE=src + +python3.7 ${CODE}/data/run_on_files.py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --files $2 --decoders $3 --model-name $4 --sample-len 80000 + diff --git a/inference.sh b/shell/inference-py.sh similarity index 74% rename from inference.sh rename to shell/inference-py.sh index f5810af..8a647ce 100755 --- a/inference.sh +++ b/shell/inference-py.sh @@ -10,6 +10,6 @@ DATE=`date +%d_%m_%Y` CODE=src OUTPUT=results/${DATE}/$1 -python3.7 ${CODE}/inference.py --model-name $3 --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT}-py -n 2 --seq 80000 \ - --files ${OUTPUT}-py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --decoders $2 --py --sample +python3.7 ${CODE}/inference.py --model-name $3 --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT}-py -n 2 \ + --files ${OUTPUT}-py --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --decoders $2 --sample-len 80000 --py diff --git a/shell/inference.sh b/shell/inference.sh new file mode 100755 index 0000000..2f9101f --- /dev/null +++ b/shell/inference.sh @@ -0,0 +1,15 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# +#!/usr/bin/env bash + +DATE=`date +%d_%m_%Y` +CODE=src +OUTPUT=results/${DATE}/$1 + +python3.7 ${CODE}/inference.py --model-name $3 --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT} -n 2 \ + --files ${OUTPUT} --batch-size 2 --checkpoint checkpoints/$1/lastmodel --output-next-to-orig --decoders $2 --sample-len 80000 + diff --git a/make_dataset.sh b/shell/make_dataset.sh similarity index 100% rename from make_dataset.sh rename to shell/make_dataset.sh diff --git a/shell/sample-pretrained-umt.sh b/shell/sample-pretrained-umt.sh new file mode 100755 index 0000000..339a554 --- /dev/null +++ b/shell/sample-pretrained-umt.sh @@ -0,0 +1,19 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# +#!/usr/bin/env bash + +DATE=`date +%d_%m_%Y` +CODE=src +OUTPUT=results/${DATE}/$1 + +python3.7 ${CODE}/data/data_samples.py \ + --data data/musicnet/preprocessed/Solo_Cello \ + data/musicnet/preprocessed/Solo_Violin \ + data/musicnet/preprocessed/Beethoven_Solo_Piano \ + --output-sampled ${OUTPUT} -n 2 + +echo "Finished writing samples to ${OUTPUT}" diff --git a/shell/sample.sh b/shell/sample.sh new file mode 100755 index 0000000..5f3e72e --- /dev/null +++ b/shell/sample.sh @@ -0,0 +1,15 @@ +# Copyright (c) Facebook, Inc. and its affiliates. +# All rights reserved. +# +# This source code is licensed under the license found in the +# LICENSE file in the root directory of this source tree. +# +#!/usr/bin/env bash + +DATE=`date +%d_%m_%Y` +CODE=src +OUTPUT=results/${DATE}/$1 + +python3.7 ${CODE}/data/data_samples.py --data-from-args checkpoints/$1/args.pth --output-sampled ${OUTPUT} -n 2 + +echo "Finished writing samples to ${OUTPUT}" diff --git a/train.sh b/shell/train.sh similarity index 100% rename from train.sh rename to shell/train.sh diff --git a/src/data/data_samples.py b/src/data/data_samples.py index 272d78b..142f49e 100755 --- a/src/data/data_samples.py +++ b/src/data/data_samples.py @@ -42,7 +42,7 @@ def main(): help='Path to data dir') parser.add_argument('--data-from-args', type=Path, help='Path to args.pth') - parser.add_argument('--output', '-o', type=Path, + parser.add_argument('--output-sampled', '-os', type=Path, help='Output path') parser.add_argument('-n', type=int, help='Num samples to make') diff --git a/src/inference.py b/src/inference.py index baa1bb8..6c1f7cd 100755 --- a/src/inference.py +++ b/src/inference.py @@ -9,7 +9,6 @@ from pathlib import Path parser = argparse.ArgumentParser() - parser.add_argument('--sample', action='store_true', help='Create data samples as inpu') # For sampling parser.add_argument('--data', type=Path, nargs='*',