|
15 | 15 | """
|
16 | 16 |
|
17 | 17 | import logging as log
|
18 |
| -import os.path as osp |
19 | 18 |
|
20 | 19 | import numpy as np
|
21 | 20 |
|
@@ -64,12 +63,9 @@ def __init__(self, model_upsample, model_rnn, ie, target=11000, overlap=550, hop
|
64 | 63 | self.mel_len = self.upsample_model.input('mels').shape[1] - 2 * self.pad
|
65 | 64 | self.rnn_width = self.rnn_model.input('h1.1').shape[1]
|
66 | 65 |
|
67 |
| - def load_network(self, model_xml): |
68 |
| - model_bin_name = ".".join(osp.basename(model_xml).split('.')[:-1]) + ".bin" |
69 |
| - model_bin = osp.join(osp.dirname(model_xml), model_bin_name) |
70 |
| - log.info('Reading WaveRNN model {}'.format(model_xml)) |
71 |
| - model = self.ie.read_model(model=model_xml, weights=model_bin) |
72 |
| - return model |
| 66 | + def load_network(self, model_path): |
| 67 | + log.info('Reading WaveRNN model {}'.format(model_path)) |
| 68 | + return self.ie.read_model(model_path) |
73 | 69 |
|
74 | 70 | def create_infer_requests(self, model, path, batch_sizes=None):
|
75 | 71 | if batch_sizes is not None:
|
@@ -221,12 +217,9 @@ def __init__(self, model, ie, device='CPU', default_width=800):
|
221 | 217 | self.mel_len = self.model.input('mel').shape[2]
|
222 | 218 | self.widths = [self.mel_len * (i + 1) for i in range(self.scales)]
|
223 | 219 |
|
224 |
| - def load_network(self, model_xml): |
225 |
| - model_bin_name = ".".join(osp.basename(model_xml).split('.')[:-1]) + ".bin" |
226 |
| - model_bin = osp.join(osp.dirname(model_xml), model_bin_name) |
227 |
| - log.info('Reading MelGAN model {}'.format(model_xml)) |
228 |
| - model = self.ie.read_model(model=model_xml, weights=model_bin) |
229 |
| - return model |
| 220 | + def load_network(self, model_path): |
| 221 | + log.info('Reading MelGAN model {}'.format(model_path)) |
| 222 | + return self.ie.read_model(model_path) |
230 | 223 |
|
231 | 224 | def create_infer_requests(self, model, path, scales=None):
|
232 | 225 | if scales is not None:
|
|
0 commit comments