base.py 文件源码

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

项目:Cognitive-Face-Python 作者: Microsoft 项目源码 文件源码
def OnDrawItem(self, dc, rect, index):
        """OnDrawItem for Layout."""
        face = self.faces[index]
        dc.DrawBitmap(face.bmp, rect.x + 2,
                      ((rect.height - face.bmp.GetHeight()) / 2) + rect.y)

        textx = rect.x + 2 + face.bmp.GetWidth() + 2
        label_rect = wx.Rect(textx, rect.y, rect.width - textx, rect.height)
        label = util.LABEL_FACE.format(
            face.attr.gender,
            face.attr.age,
            face.attr.hair,
            face.attr.facial_hair,
            face.attr.makeup,
            face.attr.emotion,
            face.attr.occlusion,
            face.attr.exposure,
            face.attr.head_pose,
            face.attr.accessories
        )
        dc.DrawLabel(label, label_rect, wx.ALIGN_LEFT | wx.ALIGN_TOP)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号