update actor5 and infer_folder_live

This commit is contained in:
liangsen committed 2022-05-10 10:47:54 +08:00
1 parent 854609dd0c
commit dac314c9a5
34 files changed
+2810 -658

No files matched your search

+3 -3
View File
@@ -10,7 +10,7 @@ import numpy as np
import onnx
import onnxruntime as rt
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../audio2motion')))
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from src.config import config as opt
from src.config import update_config
@@ -58,7 +58,7 @@ if __name__ == '__main__':
if not path_onnx.exists():
# forward
batch_input = torch.randn((20, 35, 16, 1024)).float().to(model.device) # (B, nseq, nseqlen, nc_condit)
batch_input = torch.randn((1, 35, 16, 1024)).float().to(model.device) # (B, nseq, nseqlen, nc_condit)
batch_otput = model.netG.forward(batch_input).detach().cpu().numpy() # (B, nseq, 5023, 3)
print(f"cond shape = {batch_input.shape}, batch_otput shape = {batch_otput.shape}")
# cond shape = torch.Size([20, 35, 16, 1024]), batch_otput shape = (20, 35, 5023, 3)
@@ -87,7 +87,7 @@ if __name__ == '__main__':
onnx.checker.check_model(onnx_model)
# check the numerical value
batch_input = torch.randn((20, 35, 16, 1024)).float().to(model.device) # (B, nseq, nseqlen, nc_condit)
batch_input = torch.randn((1, 35, 16, 1024)).float().to(model.device) # (B, nseq, nseqlen, nc_condit)
batch_otput = model.netG.forward(batch_input).detach().cpu().numpy() # (B, nseq, 5023, 3)
print(f"cond shape = {batch_input.shape}, batch_otput shape = {batch_otput.shape}")