create mimicmotion pipeline and load pretrained weight Args: infer_config (str): device (str or torch.device): "cpu" or "cuda:{device_id}"
(infer_config, device)
| 33 | self.pose_net = PoseNet(noise_latent_channels=self.unet.config.block_out_channels[0]) |
| 34 | |
| 35 | def create_pipeline(infer_config, device): |
| 36 | """create mimicmotion pipeline and load pretrained weight |
| 37 | |
| 38 | Args: |
| 39 | infer_config (str): |
| 40 | device (str or torch.device): "cpu" or "cuda:{device_id}" |
| 41 | """ |
| 42 | mimicmotion_models = MimicMotionModel(infer_config.base_model_path) |
| 43 | mimicmotion_models.load_state_dict(torch.load(infer_config.ckpt_path, map_location="cpu"), strict=False) |
| 44 | pipeline = MimicMotionPipeline( |
| 45 | vae=mimicmotion_models.vae, |
| 46 | image_encoder=mimicmotion_models.image_encoder, |
| 47 | unet=mimicmotion_models.unet, |
| 48 | scheduler=mimicmotion_models.noise_scheduler, |
| 49 | feature_extractor=mimicmotion_models.feature_extractor, |
| 50 | pose_net=mimicmotion_models.pose_net |
| 51 | ) |
| 52 | return pipeline |
| 53 |
nothing calls this directly
no test coverage detected