fix template_verts

This commit is contained in:
Sen Liang committed 2022-03-17 15:26:32 +08:00
1 parent a3529ab815
commit e6f471eb64
3 files changed
+6 -8

No files matched your search

@@ -8,7 +8,6 @@ isTrain: False
MODEL: MODEL:
# name: 'audio2mesh'
name: 'audio2mesh_ar' name: 'audio2mesh_ar'
name_netG: "audio2mesh_ar" name_netG: "audio2mesh_ar"
@@ -20,7 +19,6 @@ MODEL:
path_checkpoint: "experiments/audio2mesh/train_audio2meshAR_CN_20220314/20220316-23H56M06S" path_checkpoint: "experiments/audio2mesh/train_audio2meshAR_CN_20220314/20220316-23H56M06S"
load_epoch: 50 load_epoch: 50
DATASET: DATASET:
fps: 50 fps: 50
sr: 16000 sr: 16000
View File
Whitespace-only changes.
+6 -6
View File
@@ -48,16 +48,16 @@ class Audio2MeshARModel(Base):
path_deca_mean = self.opt.DATASET.path_mean_dict path_deca_mean = self.opt.DATASET.path_mean_dict
self.mean_dict = np.load(path_deca_mean, allow_pickle=True).item() self.mean_dict = np.load(path_deca_mean, allow_pickle=True).item()
print(f"mean_dict keys = {self.mean_dict.keys()}") print(f"load mean deca coeff from > {path_deca_mean}, \nkeys = {self.mean_dict.keys()}")
if self.isTrain: if self.isTrain:
self.template_verts = self.get_template_vertices() self.template_verts = self.get_template_vertices()
print(f"! get template_verts from zero expression + zero expression")
else: else:
self.template_verts = self.get_template_vertices(self.mean_dict) self.template_verts = self.get_template_vertices(self.mean_dict)
print(f"! get template_verts from {path_deca_mean}")
debug(opt, f"template_verts shape = {self.template_verts.shape}")
debug(opt, f"mean_dict keys = {self.mean_dict.keys()}", verbose=True)
# if filter outlier # if filter outlier
# if self.opt.LOSS.filter_outlier: # if self.opt.LOSS.filter_outlier:
self.loss_func_wing = WingLoss(reduction="none") # return (B, ) self.loss_func_wing = WingLoss(reduction="none") # return (B, )
@@ -264,7 +264,7 @@ class Audio2MeshARModel(Base):
batch_shape = torch.from_numpy(batch_shape).float().to(self.device) batch_shape = torch.from_numpy(batch_shape).float().to(self.device)
else: else:
batch_shape = torch.zeros(1, 100).to(self.device) batch_shape = torch.zeros(1, 100).to(self.device)
verts, _, _ = self.netR.get_vertices(batch_shape, batch_exp, batch_pos) # 1 x 5023 x 3 verts, _, _ = self.netR.get_vertices(batch_shape, batch_exp, batch_pos) # 1 x 5023 x 3
verts = verts.unsqueeze(dim=0) # 1 x 1 x 5023 x 3 verts = verts.unsqueeze(dim=0) # 1 x 1 x 5023 x 3
print(f"template verts reshape = {verts.shape}") print(f"template verts reshape = {verts.shape}")