diff --git a/__pycache__/dataset.cpython-36.pyc b/__pycache__/dataset.cpython-36.pyc index 1711f64..7bb551f 100644 Binary files a/__pycache__/dataset.cpython-36.pyc and b/__pycache__/dataset.cpython-36.pyc differ diff --git a/dataset.py b/dataset.py index 5366bd4..956d78f 100644 --- a/dataset.py +++ b/dataset.py @@ -236,9 +236,9 @@ def timeStamp(filename, term) : return_timestamp = [] for (note, fx) in zip(note_time_Stamp, fx_time_Stamp) : if note == 1 or fx == 1 : - return_timestamp.append([1]) + return_timestamp.append(1) else : - return_timestamp.append([0]) + return_timestamp.append(0) # test log index = 0 @@ -255,9 +255,9 @@ def timeStamp(filename, term) : return return_timestamp if __name__ == "__main__": - filenames = os.listdir("./test_ogg/") - KshDataset.music_cache_make(filenames) - #KshDataset.timeStamp("./data/songs/rootsphere_lastnote/exh.ksh", 3400) + #filenames = os.listdir("./test_ogg/") + #$KshDataset.music_cache_make(filenames) + KshDataset.timeStamp("./data/songs/rootsphere_lastnote/exh.ksh", 3400) #y, sr = librosa.load("./data/songs/rootsphere_lastnote/nofx.ogg", sr=44100) #KshDataset.timeStamp("./data/songs/rootsphere_lastnote/exh.ksh", y.shape[0]) #print(y.shape[0]//441) \ No newline at end of file diff --git a/infer.py b/infer.py index d273fea..84be894 100644 --- a/infer.py +++ b/infer.py @@ -71,7 +71,7 @@ def infer(model, device, batch, filename, savename) : #print(fx_time_Stamp_output) #print(fx_time_Stamp_output) - song = mp.Audio(filename = ("./test_ogg/bgm.ogg"), note_timestamp = note_time_Stamp_output, fx_timestamp = fx_time_Stamp_output) + song = mp.Audio(filename = ("./data_test/songs/badapple_nomico_alreco/nofx.ogg"), note_timestamp = note_time_Stamp_output, fx_timestamp = fx_time_Stamp_output) song.synthesize(diff='ka') song.save(filename = savename) @@ -98,7 +98,7 @@ def main(): #infer(model, device, batch, "./cache/albida.npy","./test_Output/infer.wav") #infer(model, device, batch, "./test_ogg/nofx.npy","./test_Output/infer2.wav") #infer(model, device, batch, "./Asset/KANA-BOON - Silhouette.ogg","./test_Output/infer3.wav") - infer(model, device, batch, "./test_ogg/bgm.npy","./test_Output/infer4.wav") + infer(model, device, batch, "./cache/badapple_nomico_alreco.npy","./test_Output/infer3.wav") diff --git a/net/__pycache__/model.cpython-36.pyc b/net/__pycache__/model.cpython-36.pyc index 81d487e..27f4879 100644 Binary files a/net/__pycache__/model.cpython-36.pyc and b/net/__pycache__/model.cpython-36.pyc differ diff --git a/net/model.py b/net/model.py index 29942de..031a758 100644 --- a/net/model.py +++ b/net/model.py @@ -37,7 +37,7 @@ def __init__(self): self.fc1 = nn.Linear(1024, 512) self.fc2 = nn.Linear(512, 256) - self.fc3 = nn.Linear(256, 2) + self.fc3 = nn.Linear(256, 1) #self.lstm = nn.LSTM() diff --git a/train.py b/train.py index 06ee2a4..6fcf162 100644 --- a/train.py +++ b/train.py @@ -80,7 +80,7 @@ def main(): model.to(device) #input = torch.rand(128,3,80,15) - criterion = nn.CrossEntropyLoss() + criterion = nn.MSELoss() optimizer = optim.SGD(model.parameters(), lr=0.01, momentum=0.9) scheduler = lr_scheduler.StepLR(optimizer, step_size=200, gamma=0.1) @@ -125,7 +125,7 @@ def main(): __ = 1 input = input.to(device, dtype=torch.float) - target = target.to(device, dtype=torch.int64) + target = target.to(device, dtype=torch.float) #print(input.shape) #print(target.shape)