andabi / music-source-separation

Deep neural networks for separating singing voice from music written in TensorFlow
795 stars 150 forks source link

How to finally use this module with one single song file ? #20

Open ManojDatt opened 6 years ago

ManojDatt commented 6 years ago

Which script need to run after eval.py , to get vocal separated from song ?

archmord commented 5 years ago

First, in config.py change

Train

class TrainConfig: DATA_PATH = 'dataset/mir-1k/Wavfile after that create test folder inside dataset/mir-1k/ and change NUM_EVAL = 1 SECONDS = (input how long your test wav file long in seconds)

alishibli97 commented 4 years ago

It's not working for me yet. Any clue why? This is my cinfig.py file:

-- coding: utf-8 --

!/usr/bin/env python

''' By Dabi Ahn. andabi412@gmail.com. https://www.github.com/andabi '''

import tensorflow as tf from utils import closest_power_of_two

TODO tf arg

Model

class ModelConfig: SR = 16000 # Sample Rate L_FRAME = 1024 # default 1024 L_HOP = closest_power_of_two(L_FRAME / 4) SEQ_LEN = 4

For Melspectogram

N_MELS = 512
F_MIN = 0.0

Train

class TrainConfig: CASE = str(ModelConfig.SEQ_LEN) + 'frames_ikala' CKPT_PATH = 'checkpoints/' + CASE GRAPH_PATH = 'graphs/' + CASE + '/train' DATA_PATH = 'dataset/mir-1k/Wavfile' LR = 0.0001 FINAL_STEP = 100000 CKPT_STEP = 500 NUM_WAVFILE = 1 SECONDS = 8.192 # To get 512,512 in melspecto RE_TRAIN = True session_conf = tf.ConfigProto( device_count={'CPU': 1, 'GPU': 1}, gpu_options=tf.GPUOptions( allow_growth=True, per_process_gpu_memory_fraction=0.25 ), )

TODO seperating model and case

TODO config for each case

Eval

class EvalConfig:

CASE = '1frame'

# CASE = '4-frames-masking-layer'
CASE = str(ModelConfig.SEQ_LEN) + 'frames_ikala'
CKPT_PATH = 'checkpoints/' + CASE
GRAPH_PATH = 'graphs/' + CASE + '/eval'
#DATA_PATH = 'dataset/eval/kpop'
DATA_PATH = 'dataset/mine'
# DATA_PATH = 'dataset/ikala'
GRIFFIN_LIM = False
GRIFFIN_LIM_ITER = 1000
NUM_EVAL = 1
SECONDS = 60
RE_EVAL = True
EVAL_METRIC = False
WRITE_RESULT = True
RESULT_PATH = 'results/' + CASE
session_conf = tf.ConfigProto(
    device_count={'CPU': 1, 'GPU': 1},
    gpu_options=tf.GPUOptions(allow_growth=True),
    log_device_placement=False
)