MCPcopy
hub / github.com/Wan-Video/Wan2.2 / prepare_source

Method prepare_source

wan/animate.py:269–282  ·  view source on GitHub ↗
(self, src_pose_path, src_face_path, src_ref_path)

Source from the content-addressed store, hash-verified

267 return img_pad
268
269 def prepare_source(self, src_pose_path, src_face_path, src_ref_path):
270 pose_video_reader = VideoReader(src_pose_path)
271 pose_len = len(pose_video_reader)
272 pose_idxs = list(range(pose_len))
273 cond_images = pose_video_reader.get_batch(pose_idxs).asnumpy()
274
275 face_video_reader = VideoReader(src_face_path)
276 face_len = len(face_video_reader)
277 face_idxs = list(range(face_len))
278 face_images = face_video_reader.get_batch(face_idxs).asnumpy()
279 height, width = cond_images[0].shape[:2]
280 refer_images = cv2.imread(src_ref_path)[..., ::-1]
281 refer_images = self.padding_resize(refer_images, height=height, width=width)
282 return cond_images, face_images, refer_images
283
284 def prepare_source_for_replace(self, src_bg_path, src_mask_path):
285 bg_video_reader = VideoReader(src_bg_path)

Callers 1

generateMethod · 0.95

Calls 1

padding_resizeMethod · 0.95

Tested by

no test coverage detected