generator.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:DeepPoseComparison 作者: ynaka81 项目源码 文件源码
def _pad_image(self, image, joint):
        height, width, _ = image.shape
        shape = np.array((width, height))
        residual = (self.image_size - shape).clip(0, self.image_size)
        left, top = residual/2
        right, bottom = residual - residual/2
        padded_image = cv2.copyMakeBorder(
            image, top, bottom, left, right, cv2.BORDER_CONSTANT, value=0)
        moved_joint = joint + (left, top, 0)
        return padded_image, moved_joint
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号