demo_app1.py 文件源码

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

项目:face-identification-tpe 作者: meownoid 项目源码 文件源码
def draw_box(self, n, box, color, style, num):
        x1, y1, x2, y2 = box.left(), box.top(), box.right(), box.bottom()

        x1 = int(x1 * self.i_scale[n])
        y1 = int(y1 * self.i_scale[n])
        x2 = int(x2 * self.i_scale[n])
        y2 = int(y2 * self.i_scale[n])

        width = BASEWIDTH
        if style == 'match':
            width *= 2

        painter = QPainter(self.i_pixmap[n])
        painter.setPen(QPen(QBrush(color), width))
        painter.drawRect(x1, y1, x2 - x1, y2 - y1)
        painter.setPen(QPen(QBrush(TEXTCOLOR), TEXTWIDTH))
        painter.setFont(TEXTFONT)
        painter.drawText(x1, y2 + TEXTSIZE + 2 * BASEWIDTH, '{}: {}'.format(n + 1, num))
        painter.end()
        self.i_lbl[n].setPixmap(self.i_pixmap[n])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号