def OnChooseImage(self, evt, bitmap, face_id):
"""Choose Image"""
dlg = wx.FileDialog(self, wildcard=util.IMAGE_WILDCARD)
if dlg.ShowModal() != wx.ID_OK:
return
path = dlg.GetPath()
self.log.log('Request: Detecting {}'.format(path))
res = util.CF.face.detect(path)
faces = [model.Face(face, path) for face in res]
self.log.log('Response: Success. Detected {} face(s) in {}'.format(
len(res), path))
if len(faces) > 1:
text = (
'Verification accepts two faces as input, please pick images'
'with only one detectable face in it.'
)
title = 'Warning'
style = wx.OK | wx.ICON_WARNING
wx.MessageBox(text, title, style)
return
bitmap.set_path(path)
util.draw_bitmap_rectangle(bitmap, faces)
self.face_ids[face_id] = faces[0].id
self.check_btn_verify()
panel_verification.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录