(self, det_checkpoint_path, pose2d_checkpoint_path, sam_checkpoint_path, flux_kontext_path)
| 41 | |
| 42 | class ProcessPipeline: |
| 43 | def __init__(self, det_checkpoint_path, pose2d_checkpoint_path, sam_checkpoint_path, flux_kontext_path): |
| 44 | self.pose2d = Pose2d(checkpoint=pose2d_checkpoint_path, detector_checkpoint=det_checkpoint_path) |
| 45 | |
| 46 | model_cfg = "sam2_hiera_l.yaml" |
| 47 | if sam_checkpoint_path is not None: |
| 48 | if not _SAM2_AVAILABLE: |
| 49 | raise RuntimeError("sam2 is required for preprocessing but is not installed. Please install sam2.") |
| 50 | self.predictor = build_sam2_video_predictor(model_cfg, sam_checkpoint_path) |
| 51 | if flux_kontext_path is not None: |
| 52 | from diffusers import FluxKontextPipeline |
| 53 | |
| 54 | self.flux_kontext = FluxKontextPipeline.from_pretrained(flux_kontext_path, torch_dtype=torch.bfloat16).to("cuda") |
| 55 | |
| 56 | @staticmethod |
| 57 | def _get_body_keypoints(pose_meta): |
nothing calls this directly
no test coverage detected