jhtonyKoo commited on
Commit
587b58f
1 Parent(s): c8618b9
__pycache__/config.cpython-311.pyc ADDED
Binary file (2.35 kB). View file
 
__pycache__/inference.cpython-311.pyc ADDED
Binary file (21.6 kB). View file
 
__pycache__/utils.cpython-311.pyc ADDED
Binary file (958 Bytes). View file
 
app.py CHANGED
@@ -5,15 +5,7 @@ import numpy as np
5
  import yaml
6
  from inference import MasteringStyleTransfer
7
  from utils import download_youtube_audio
8
- from config import config
9
-
10
- # Initialize MasteringStyleTransfer
11
- args = type('Args', (), vars(config))()
12
- # load network configurations
13
- with open(args.path_to_config, 'r') as f:
14
- configs = yaml.full_load(f)
15
- args.cfg_converter = configs['TCN']['param_mapping']
16
- args.cfg_enc = configs['Effects_Encoder']['default']
17
 
18
  mastering_transfer = MasteringStyleTransfer(args)
19
 
 
5
  import yaml
6
  from inference import MasteringStyleTransfer
7
  from utils import download_youtube_audio
8
+ from config import args
 
 
 
 
 
 
 
 
9
 
10
  mastering_transfer = MasteringStyleTransfer(args)
11
 
config.py CHANGED
@@ -1,28 +1,23 @@
1
- import os
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- class Config:
4
- model_path = "models/mastering_converter.pt"
5
- encoder_path = "models/effects_encoder.pt"
6
- sample_rate = 44100
7
- path_to_config = "networks/configs.yaml"
8
-
9
- # Add more configurations as needed
10
- inference_only = True
11
- evaluate_only = False
12
- reload_enc = True
13
- reload_converter = True
14
- manual_reload_enc = False
15
- manual_reload_converter = False
16
- manual_reload_name_converter = "dasp_tcn_tuneenc_daspman_loudnessnorm"
17
- manual_reload_name_encoder = "dasp_tcn_tuneenc_daspman_loudnessnorm"
18
- manual_reload_enc_path = "models/effects_encoder.pt"
19
- reload_epoch_converter = 1000
20
- reload_epoch_enc = 1000
21
-
22
- # Add other configurations from the main.py file
23
- random_seed = 111
24
- train_ito = True
25
- max_iter_ito = 101
26
- ito_type = "blackbox"
27
 
28
- config = Config()
 
1
+ import argparse
2
+ import yaml
3
+
4
+ parser = argparse.ArgumentParser(description="Mastering Style Transfer")
5
+ parser.add_argument("--model_path", type=str, default=f"models/white_box_converter.pt", help="Path to mastering converter model")
6
+ parser.add_argument("--encoder_path", type=str, default=f"models/mastering_effects_encoder.pt", help="Path to effects encoder model")
7
+ parser.add_argument("--perform_ito", action="store_true", help="Whether to perform ITO")
8
+ parser.add_argument("--optimizer", type=str, default="RAdam", help="Optimizer for ITO")
9
+ parser.add_argument("--learning_rate", type=float, default=0.001, help="Learning rate for ITO")
10
+ parser.add_argument("--num_steps", type=int, default=100, help="Number of optimization steps for ITO")
11
+ parser.add_argument("--af_weights", nargs='+', type=float, default=[0.1, 0.001, 1.0, 1.0, 0.1], help="Weights for AudioFeatureLoss")
12
+ parser.add_argument("--sample_rate", type=int, default=44100, help="Sample rate for AudioFeatureLoss")
13
+ parser.add_argument("--path_to_config", type=str, default='networks/configs.yaml', help="Path to network architecture configuration file")
14
+
15
+ args = parser.parse_args()
16
+
17
+ # load network configurations
18
+ with open(args.path_to_config, 'r') as f:
19
+ configs = yaml.full_load(f)
20
+ args.cfg_converter = configs['TCN']['param_mapping']
21
+ args.cfg_enc = configs['Effects_Encoder']['default']
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
 
modules/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (234 Bytes). View file
 
modules/__pycache__/filter.cpython-311.pyc ADDED
Binary file (6.47 kB). View file
 
modules/__pycache__/front_back_end.cpython-311.pyc ADDED
Binary file (16.7 kB). View file
 
modules/__pycache__/loss.cpython-311.pyc ADDED
Binary file (21 kB). View file
 
networks/__pycache__/__init__.cpython-311.pyc ADDED
Binary file (281 Bytes). View file
 
networks/__pycache__/architectures.cpython-311.pyc ADDED
Binary file (20.3 kB). View file
 
networks/__pycache__/dasp_additionals.cpython-311.pyc ADDED
Binary file (19 kB). View file
 
networks/__pycache__/network_utils.cpython-311.pyc ADDED
Binary file (13.5 kB). View file