示例#1
0
    def __init__(self):
        super().__init__()
        if self.weights is not None:
            caf_weights = []
            for bone in WHOLEBODY_SKELETON:
                caf_weights.append(
                    max(self.weights[bone[0] - 1], self.weights[bone[1] - 1]))
            w_np = np.array(caf_weights)
            caf_weights = list(w_np / np.sum(w_np) * len(caf_weights))
        else:
            caf_weights = None
        cif = headmeta.Cif('cif',
                           'wholebodykp',
                           keypoints=WHOLEBODY_KEYPOINTS,
                           sigmas=WHOLEBODY_SIGMAS,
                           pose=WHOLEBODY_STANDING_POSE,
                           draw_skeleton=WHOLEBODY_SKELETON,
                           score_weights=WHOLEBODY_SCORE_WEIGHTS,
                           training_weights=self.weights)
        caf = headmeta.Caf('caf',
                           'wholebodykp',
                           keypoints=WHOLEBODY_KEYPOINTS,
                           sigmas=WHOLEBODY_SIGMAS,
                           pose=WHOLEBODY_STANDING_POSE,
                           skeleton=WHOLEBODY_SKELETON,
                           training_weights=caf_weights)

        cif.upsample_stride = self.upsample_stride
        caf.upsample_stride = self.upsample_stride
        self.head_metas = [cif, caf]
示例#2
0
    def __init__(self):
        super().__init__()

        cif = headmeta.Cif('cif',
                           'apollo',
                           keypoints=self.CAR_KEYPOINTS,
                           sigmas=self.CAR_SIGMAS,
                           pose=self.CAR_POSE,
                           draw_skeleton=self.CAR_SKELETON,
                           score_weights=self.CAR_SCORE_WEIGHTS)
        caf = headmeta.Caf('caf',
                           'apollo',
                           keypoints=self.CAR_KEYPOINTS,
                           sigmas=self.CAR_SIGMAS,
                           pose=self.CAR_POSE,
                           skeleton=self.CAR_SKELETON)

        cif.upsample_stride = self.upsample_stride
        caf.upsample_stride = self.upsample_stride
        self.head_metas = [cif, caf]