modify inter handler
This commit is contained in:
parent
1bfb79b45a
commit
f86368bc37
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 26 KiB |
@ -59,7 +59,7 @@ class AudioInferenceHandler(AudioHandler):
|
|||||||
super().on_message(message)
|
super().on_message(message)
|
||||||
|
|
||||||
def __on_run(self):
|
def __on_run(self):
|
||||||
wav2lip_path = os.path.join(current_file_path, '..', 'checkpoints', 'wav2lip_gan.pth')
|
wav2lip_path = os.path.join(current_file_path, '..', 'checkpoints', 'wav2lip.pth')
|
||||||
logger.info(f'AudioInferenceHandler init, path:{wav2lip_path}')
|
logger.info(f'AudioInferenceHandler init, path:{wav2lip_path}')
|
||||||
model = load_model(wav2lip_path)
|
model = load_model(wav2lip_path)
|
||||||
logger.info("Model loaded")
|
logger.info("Model loaded")
|
||||||
@ -130,7 +130,7 @@ class AudioInferenceHandler(AudioHandler):
|
|||||||
|
|
||||||
img_batch = torch.FloatTensor(np.transpose(img_batch, (0, 3, 1, 2))).to(device)
|
img_batch = torch.FloatTensor(np.transpose(img_batch, (0, 3, 1, 2))).to(device)
|
||||||
mel_batch = torch.FloatTensor(np.transpose(mel_batch, (0, 3, 1, 2))).to(device)
|
mel_batch = torch.FloatTensor(np.transpose(mel_batch, (0, 3, 1, 2))).to(device)
|
||||||
# print('img_batch:', img_batch.shape, 'mel_batch:', mel_batch.shape)
|
print('img_batch:', img_batch.shape, 'mel_batch:', mel_batch.shape)
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
pred = model(mel_batch, img_batch)
|
pred = model(mel_batch, img_batch)
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ current_file_path = os.path.dirname(os.path.abspath(__file__))
|
|||||||
class HumanContext:
|
class HumanContext:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._fps = 50 # 20 ms per frame
|
self._fps = 50 # 20 ms per frame
|
||||||
self._image_size = 128
|
self._image_size = 288
|
||||||
self._batch_size = 16
|
self._batch_size = 16
|
||||||
self._sample_rate = 16000
|
self._sample_rate = 16000
|
||||||
self._stride_left_size = 10
|
self._stride_left_size = 10
|
||||||
|
Loading…
Reference in New Issue
Block a user