Spanicin commited on
Commit
a815574
·
verified ·
1 Parent(s): ca16892

Update src/facerender/modules/make_animation.py

Browse files
src/facerender/modules/make_animation.py CHANGED
@@ -162,22 +162,22 @@ def make_animation(source_image, source_semantics, target_semantics,
162
 
163
  with autocast():
164
  for frame_idx in tqdm(range(target_semantics.shape[1]), desc='Face Renderer:', unit='frame'):
165
- target_semantics_frame = target_semantics[:, frame_idx]
166
- he_driving = mapping(target_semantics_frame)
167
-
168
- if yaw_c_seq is not None:
169
- he_driving['yaw_in'] = yaw_c_seq[:, frame_idx]
170
- if pitch_c_seq is not None:
171
- he_driving['pitch_in'] = pitch_c_seq[:, frame_idx]
172
- if roll_c_seq is not None:
173
- he_driving['roll_in'] = roll_c_seq[:, frame_idx]
174
-
175
- kp_driving = keypoint_transformation(kp_canonical, he_driving)
176
- kp_norm = kp_driving
177
-
178
- out = generator(source_image, kp_source=kp_source, kp_driving=kp_norm)
179
-
180
- predictions.append(out['prediction'])
181
 
182
  torch.cuda.synchronize()
183
 
 
162
 
163
  with autocast():
164
  for frame_idx in tqdm(range(target_semantics.shape[1]), desc='Face Renderer:', unit='frame'):
165
+ target_semantics_frame = target_semantics[:, frame_idx]
166
+ he_driving = mapping(target_semantics_frame)
167
+
168
+ if yaw_c_seq is not None:
169
+ he_driving['yaw_in'] = yaw_c_seq[:, frame_idx]
170
+ if pitch_c_seq is not None:
171
+ he_driving['pitch_in'] = pitch_c_seq[:, frame_idx]
172
+ if roll_c_seq is not None:
173
+ he_driving['roll_in'] = roll_c_seq[:, frame_idx]
174
+
175
+ kp_driving = keypoint_transformation(kp_canonical, he_driving)
176
+ kp_norm = kp_driving
177
+
178
+ out = generator(source_image, kp_source=kp_source, kp_driving=kp_norm)
179
+
180
+ predictions.append(out['prediction'])
181
 
182
  torch.cuda.synchronize()
183