def __init__(self, parent):
        super(GroupPanel, self).__init__(parent)

        self.face_paths = []
        self.faces = {}

        self.vsizer = wx.BoxSizer(wx.VERTICAL)

        self.panel = scrolled.ScrolledPanel(self)

        self.hsizer = wx.BoxSizer()
        self.hsizer.AddStretchSpacer()

        self.hvsizer = wx.BoxSizer(wx.VERTICAL)
        self.hvsizer.SetMinSize((util.INNER_PANEL_WIDTH, -1))

        label = ('Click the button below to select a folder containing face '
                 'images.\nThe images will be grouped based on similarity.\n'
                 'You will see the different groups under the "Grouping '
                 'Results" label.')
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer = wx.BoxSizer()

        self.lsizer = wx.BoxSizer(wx.VERTICAL)
        self.lsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn = wx.Button(self.panel, label='Group')
        self.lsizer.Add(self.btn, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseFolder, self.btn)

        self.grid = base.MyGridStaticBitmap(self.panel, 0, 4, 0, 0)
        self.lsizer.Add(self.grid, 0, wx.ALL, 5)

        self.vhsizer.Add(self.lsizer, 1, wx.EXPAND)
        self.vhsizer.AddSpacer(90)

        self.rsizer = wx.BoxSizer(wx.VERTICAL)
        self.rsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.ALIGN_CENTER | wx.EXPAND | wx.ALL
        self.result_text = wx.StaticText(self.panel, label='Grouping Results:')
        self.rsizer.Add(self.result_text, 0, flag, 5)

        self.result = base.GroupResult(self.panel)
        self.rsizer.Add(self.result, 0, wx.EXPAND)

        self.vhsizer.Add(self.rsizer, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer)

        self.hsizer.Add(self.hvsizer)
        self.hsizer.AddStretchSpacer()
        self.hsizer.Layout()

        self.panel.SetSizer(self.hsizer)
        self.panel.Layout()
        self.panel.SetupScrolling(scroll_x=False)

        self.vsizer.Add(self.panel, 3, wx.EXPAND)

        self.log = base.MyLog(self)
        self.vsizer.Add(self.log, 1, wx.EXPAND)

        self.SetSizerAndFit(self.vsizer)
    def __init__(self, parent):
        super(GroupPanel, self).__init__(parent)

        self.face_paths = []
        self.faces = {}

        self.vsizer = wx.BoxSizer(wx.VERTICAL)

        self.panel = scrolled.ScrolledPanel(self)

        self.hsizer = wx.BoxSizer()
        self.hsizer.AddStretchSpacer()

        self.hvsizer = wx.BoxSizer(wx.VERTICAL)
        self.hvsizer.SetMinSize((util.INNER_PANEL_WIDTH, -1))

        label = (
            "Put similar faces to same group according to appearance "
            "similarity. You can pick an image folder for grouping by "
            "'Group', doing this will group all detected faces and shown "
            "under Grouping Result."
        )
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer = wx.BoxSizer()

        self.lsizer = wx.BoxSizer(wx.VERTICAL)
        self.lsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn = wx.Button(self.panel, label='Group')
        self.lsizer.Add(self.btn, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseFolder, self.btn)

        self.grid = base.MyGridStaticBitmap(self.panel, 0, 4, 0, 0)
        self.lsizer.Add(self.grid, 0, wx.ALL, 5)

        self.vhsizer.Add(self.lsizer, 1, wx.EXPAND)
        self.vhsizer.AddSpacer(90)

        self.rsizer = wx.BoxSizer(wx.VERTICAL)
        self.rsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.ALIGN_CENTER | wx.EXPAND | wx.ALL
        self.result_text = wx.StaticText(self.panel, label='Grouping Results:')
        self.rsizer.Add(self.result_text, 0, flag, 5)

        self.result = base.GroupResult(self.panel)
        self.rsizer.Add(self.result, 0, wx.EXPAND)

        self.vhsizer.Add(self.rsizer, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer)

        self.hsizer.Add(self.hvsizer)
        self.hsizer.AddStretchSpacer()
        self.hsizer.Layout()

        self.panel.SetSizer(self.hsizer)
        self.panel.Layout()
        self.panel.SetupScrolling(scroll_x=False)

        self.vsizer.Add(self.panel, 3, wx.EXPAND)

        self.log = base.MyLog(self)
        self.vsizer.Add(self.log, 1, wx.EXPAND)

        self.SetSizerAndFit(self.vsizer)
Пример #3
0
    def __init__(self, parent):
        super(VerificationPanel, self).__init__(parent)

        self.face_ids = {
            'face_id': None,
            'another_face_id': None,
            'person_face_id': None,
        }
        self.large_person_group_id = str(uuid.uuid1())
        self.person_name = None
        self.person_id = None
        self.face_paths = []
        self.detected_face_paths = []

        self.vsizer = wx.BoxSizer(wx.VERTICAL)

        self.panel = scrolled.ScrolledPanel(self)

        self.hsizer = wx.BoxSizer()
        self.hsizer.AddStretchSpacer()

        self.hvsizer = wx.BoxSizer(wx.VERTICAL)
        self.hvsizer.SetMinSize((util.INNER_PANEL_WIDTH, -1))

        label = ("Demo 1: Face-to-face verification determines whether "
                 "two faces belong to the same person. Choose two images "
                 "with a single face each. Then click 'Verify' to get "
                 "the verification result.")
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer1 = wx.BoxSizer()

        self.lsizer1 = wx.BoxSizer(wx.VERTICAL)
        self.lsizer1.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2face_1 = wx.Button(self.panel, label='Choose Image')
        self.lsizer1.Add(self.btn_face2face_1, 0, flag, 5)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap_face2face_1 = base.MyStaticBitmap(self.panel)
        self.lsizer1.Add(self.bitmap_face2face_1, 0, flag, 5)

        self.btn_face2face_1.Bind(
            wx.EVT_BUTTON, lambda evt: self.OnChooseImage(
                evt, self.bitmap_face2face_1, 'face_id'))

        self.vhsizer1.Add(self.lsizer1, 1, wx.EXPAND)

        self.msizer1 = wx.BoxSizer(wx.VERTICAL)
        self.msizer1.SetMinSize((90, -1))

        self.btn_verify_1 = wx.Button(self.panel, label='Verify')
        self.msizer1.Add(self.btn_verify_1, 0, wx.EXPAND | wx.ALL, 5)

        self.result_1 = wx.StaticText(self.panel, label='Results:')
        self.msizer1.Add(self.result_1, 0, wx.EXPAND | wx.ALL, 5)

        self.btn_verify_1.Bind(
            wx.EVT_BUTTON,
            lambda evt: self.OnVerify(evt, 'face2face', self.result_1))

        self.vhsizer1.Add(self.msizer1, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        self.rsizer1 = wx.BoxSizer(wx.VERTICAL)
        self.rsizer1.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2face_2 = wx.Button(self.panel, label='Choose Image')
        self.rsizer1.Add(self.btn_face2face_2, 0, flag, 5)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap_face2face_2 = base.MyStaticBitmap(self.panel)
        self.rsizer1.Add(self.bitmap_face2face_2, 0, flag, 5)

        self.btn_face2face_2.Bind(
            wx.EVT_BUTTON, lambda evt: self.OnChooseImage(
                evt, self.bitmap_face2face_2, 'another_face_id'))

        self.vhsizer1.Add(self.rsizer1, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer1)

        label = ("Demo 2: Face-to-person verification determines whether a "
                 "face belongs to a given person. Click 'Load Person' to "
                 "pick a folder containing the images of one person's face. "
                 "Next, click 'Choose Image' to pick a face image of the "
                 "same person (or of a different person). Finally, click "
                 "'Verify' to see the verification result.")
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer2 = wx.BoxSizer()

        self.lsizer2 = wx.BoxSizer(wx.VERTICAL)
        self.lsizer2.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2person_1 = wx.Button(self.panel, label='Load Person')
        self.lsizer2.Add(self.btn_face2person_1, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseFolder, self.btn_face2person_1)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.grid = base.MyGridStaticBitmap(self.panel, 0, 4, 0, 0)
        self.lsizer2.Add(self.grid, 0, flag, 5)

        self.vhsizer2.Add(self.lsizer2, 1, wx.EXPAND)

        self.msizer2 = wx.BoxSizer(wx.VERTICAL)
        self.msizer2.SetMinSize((90, -1))

        self.btn_verify_2 = wx.Button(self.panel, label='Verify')
        self.msizer2.Add(self.btn_verify_2, 0, wx.EXPAND | wx.ALL, 5)

        self.result_2 = wx.StaticText(self.panel, label='Results:')
        self.msizer2.Add(self.result_2, 0, wx.EXPAND | wx.ALL, 5)

        self.btn_verify_2.Bind(
            wx.EVT_BUTTON,
            lambda evt: self.OnVerify(evt, 'face2person', self.result_2))

        self.vhsizer2.Add(self.msizer2, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        self.rsizer2 = wx.BoxSizer(wx.VERTICAL)
        self.rsizer2.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2person_2 = wx.Button(self.panel, label='Choose Image')
        self.rsizer2.Add(self.btn_face2person_2, 0, flag, 5)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap_face2person = base.MyStaticBitmap(self.panel)
        self.rsizer2.Add(self.bitmap_face2person, 0, flag, 5)

        self.btn_face2person_2.Bind(
            wx.EVT_BUTTON, lambda evt: self.OnChooseImage(
                evt, self.bitmap_face2person, 'person_face_id'))

        self.vhsizer2.Add(self.rsizer2, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer2)

        self.hsizer.Add(self.hvsizer)
        self.hsizer.AddStretchSpacer()
        self.hsizer.Layout()

        self.panel.SetSizer(self.hsizer)
        self.panel.Layout()
        self.panel.SetupScrolling(scroll_x=False)

        self.vsizer.Add(self.panel, 3, wx.EXPAND)

        self.log = base.MyLog(self)
        self.vsizer.Add(self.log, 1, wx.EXPAND)

        self.SetSizerAndFit(self.vsizer)

        self.btn_verify_1.Disable()
        self.btn_verify_2.Disable()
Пример #4
0
    def __init__(self, parent):
        super(FindSimilarPanel, self).__init__(parent)

        self.large_face_list_id = str(uuid.uuid1())
        self.face_paths = []
        self.detected_face_paths = []
        self.faces = {}
        self.persisted_faces = {}

        self.vsizer = wx.BoxSizer(wx.VERTICAL)

        self.panel = scrolled.ScrolledPanel(self)

        self.hsizer = wx.BoxSizer()
        self.hsizer.AddStretchSpacer()

        self.hvsizer = wx.BoxSizer(wx.VERTICAL)
        self.hvsizer.SetMinSize((util.INNER_PANEL_WIDTH, -1))

        label = ('Find faces that are similar to a given face (the query '
                 'face).\nClick "Load Candidate Faces" to select a folder '
                 'containing images of the faces you want to compare to the '
                 'query face.\nNext, click "Open Query Face" to select the '
                 'query face image.\nScroll down to see the results '
                 'displayed under the query face.\n')
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer = wx.BoxSizer()

        self.lsizer = wx.BoxSizer(wx.VERTICAL)
        self.lsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_folder = wx.Button(self.panel, label='Load Candidate Faces')
        self.lsizer.Add(self.btn_folder, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseFolder, self.btn_folder)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.grid = base.MyGridStaticBitmap(self.panel, 0, 4, 0, 0)
        self.lsizer.Add(self.grid, 0, flag, 5)

        self.vhsizer.Add(self.lsizer, 1, wx.EXPAND)
        self.vhsizer.AddSpacer(90)

        self.rsizer = wx.BoxSizer(wx.VERTICAL)
        self.rsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_file = wx.Button(self.panel, label='Open Query Face')
        self.rsizer.Add(self.btn_file, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseImage, self.btn_file)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap = base.MyStaticBitmap(self.panel)
        self.rsizer.Add(self.bitmap, 0, flag, 5)

        self.result = base.FindSimilarsResult(self.panel)
        self.rsizer.Add(self.result, 0, wx.EXPAND)

        self.vhsizer.Add(self.rsizer, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer)

        self.hsizer.Add(self.hvsizer)
        self.hsizer.AddStretchSpacer()
        self.hsizer.Layout()

        self.panel.SetSizer(self.hsizer)
        self.panel.Layout()
        self.panel.SetupScrolling(scroll_x=False)

        self.vsizer.Add(self.panel, 3, wx.EXPAND)

        self.log = base.MyLog(self)
        self.vsizer.Add(self.log, 1, wx.EXPAND)

        self.SetSizerAndFit(self.vsizer)

        self.btn_file.Disable()
    def __init__(self, parent):
        super(VerificationPanel, self).__init__(parent)

        self.face_ids = {
            'face_id': None,
            'another_face_id': None,
            'person_face_id': None,
        }
        self.person_group_id = str(uuid.uuid1())
        self.person_name = None
        self.person_id = None
        self.face_paths = []
        self.detected_face_paths = []

        self.vsizer = wx.BoxSizer(wx.VERTICAL)

        self.panel = scrolled.ScrolledPanel(self)

        self.hsizer = wx.BoxSizer()
        self.hsizer.AddStretchSpacer()

        self.hvsizer = wx.BoxSizer(wx.VERTICAL)
        self.hvsizer.SetMinSize((util.INNER_PANEL_WIDTH, -1))

        label = (
            "Demo 1: Face to Face Verification determines whether two faces"
            "belong to the same person. You can pick single face image, the"
            "detected face will be shown on the image. Then click 'Verify' to"
            "get the verification result.")
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer1 = wx.BoxSizer()

        self.lsizer1 = wx.BoxSizer(wx.VERTICAL)
        self.lsizer1.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2face_1 = wx.Button(self.panel, label='Choose Image')
        self.lsizer1.Add(self.btn_face2face_1, 0, flag, 5)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap_face2face_1 = base.MyStaticBitmap(self.panel)
        self.lsizer1.Add(self.bitmap_face2face_1, 0, flag, 5)

        self.btn_face2face_1.Bind(
            wx.EVT_BUTTON, lambda evt: self.OnChooseImage(
                evt, self.bitmap_face2face_1, 'face_id'))

        self.vhsizer1.Add(self.lsizer1, 1, wx.EXPAND)

        self.msizer1 = wx.BoxSizer(wx.VERTICAL)
        self.msizer1.SetMinSize((90, -1))

        self.btn_verify_1 = wx.Button(self.panel, label='Verify')
        self.msizer1.Add(self.btn_verify_1, 0, wx.EXPAND | wx.ALL, 5)

        self.result_1 = wx.StaticText(self.panel, label='Results:')
        self.msizer1.Add(self.result_1, 0, wx.EXPAND | wx.ALL, 5)

        self.btn_verify_1.Bind(
            wx.EVT_BUTTON,
            lambda evt: self.OnVerify(evt, 'face2face', self.result_1))

        self.vhsizer1.Add(self.msizer1, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        self.rsizer1 = wx.BoxSizer(wx.VERTICAL)
        self.rsizer1.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2face_2 = wx.Button(self.panel, label='Choose Image')
        self.rsizer1.Add(self.btn_face2face_2, 0, flag, 5)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap_face2face_2 = base.MyStaticBitmap(self.panel)
        self.rsizer1.Add(self.bitmap_face2face_2, 0, flag, 5)

        self.btn_face2face_2.Bind(
            wx.EVT_BUTTON, lambda evt: self.OnChooseImage(
                evt, self.bitmap_face2face_2, 'another_face_id'))

        self.vhsizer1.Add(self.rsizer1, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer1)

        label = (
            "Demo 2: Face to person verification determines whether one face "
            "belongs to one person. You can pick an image folder containing "
            "one person's single face, and another single face image. Then "
            "click 'Verify' to get the verification result.")
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer2 = wx.BoxSizer()

        self.lsizer2 = wx.BoxSizer(wx.VERTICAL)
        self.lsizer2.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2person_1 = wx.Button(self.panel, label='Load Person')
        self.lsizer2.Add(self.btn_face2person_1, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseFolder, self.btn_face2person_1)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.grid = base.MyGridStaticBitmap(self.panel, 0, 4, 0, 0)
        self.lsizer2.Add(self.grid, 0, flag, 5)

        self.vhsizer2.Add(self.lsizer2, 1, wx.EXPAND)

        self.msizer2 = wx.BoxSizer(wx.VERTICAL)
        self.msizer2.SetMinSize((90, -1))

        self.btn_verify_2 = wx.Button(self.panel, label='Verify')
        self.msizer2.Add(self.btn_verify_2, 0, wx.EXPAND | wx.ALL, 5)

        self.result_2 = wx.StaticText(self.panel, label='Results:')
        self.msizer2.Add(self.result_2, 0, wx.EXPAND | wx.ALL, 5)

        self.btn_verify_2.Bind(
            wx.EVT_BUTTON,
            lambda evt: self.OnVerify(evt, 'face2person', self.result_2))

        self.vhsizer2.Add(self.msizer2, 0, wx.ALIGN_CENTER | wx.ALL, 5)

        self.rsizer2 = wx.BoxSizer(wx.VERTICAL)
        self.rsizer2.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_face2person_2 = wx.Button(self.panel, label='Choose Image')
        self.rsizer2.Add(self.btn_face2person_2, 0, flag, 5)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap_face2person = base.MyStaticBitmap(self.panel)
        self.rsizer2.Add(self.bitmap_face2person, 0, flag, 5)

        self.btn_face2person_2.Bind(
            wx.EVT_BUTTON, lambda evt: self.OnChooseImage(
                evt, self.bitmap_face2person, 'person_face_id'))

        self.vhsizer2.Add(self.rsizer2, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer2)

        self.hsizer.Add(self.hvsizer)
        self.hsizer.AddStretchSpacer()
        self.hsizer.Layout()

        self.panel.SetSizer(self.hsizer)
        self.panel.Layout()
        self.panel.SetupScrolling(scroll_x=False)

        self.vsizer.Add(self.panel, 3, wx.EXPAND)

        self.log = base.MyLog(self)
        self.vsizer.Add(self.log, 1, wx.EXPAND)

        self.SetSizerAndFit(self.vsizer)

        self.btn_verify_1.Disable()
        self.btn_verify_2.Disable()
Пример #6
0
    def __init__(self, parent):
        super(FindSimilarPanel, self).__init__(parent)

        self.face_list_id = str(uuid.uuid1())
        self.face_list_name = self.face_list_id
        self.face_paths = []
        self.detected_face_paths = []
        self.faces = {}
        self.persisted_faces = {}

        self.vsizer = wx.BoxSizer(wx.VERTICAL)

        self.panel = scrolled.ScrolledPanel(self)

        self.hsizer = wx.BoxSizer()
        self.hsizer.AddStretchSpacer()

        self.hvsizer = wx.BoxSizer(wx.VERTICAL)
        self.hvsizer.SetMinSize((util.INNER_PANEL_WIDTH, -1))

        label = (
            "Find similar faces for the query face from all the candidates. "
            "You can pick an image folder, and all detected faces inside the "
            "folder will be treated as candidate. Use 'Open Query Face' to "
            "pick the query faces. The result will be list as 'query face's "
            "thumbnail', 'similar faces' thumbnails with similarity ranked'. "
            "Both of 'MatchPerson' mode and 'MatchFace' mode results will be "
            "listed. 'MatchPerson' mode return the top candidate faces among "
            "those recognized as the same person with the query face, so if "
            "no candidate faces are recognized as the same person with the "
            "query face, no one will be returned, while 'MatchFace' mode "
            "returns the top candidate faces with highest similarity "
            "confidence without checking if the returned face belong to the "
            "same person with the query face. ")
        self.static_text = wx.StaticText(self.panel, label=label)
        self.static_text.Wrap(util.INNER_PANEL_WIDTH)
        self.hvsizer.Add(self.static_text, 0, wx.ALL, 0)

        self.vhsizer = wx.BoxSizer()

        self.lsizer = wx.BoxSizer(wx.VERTICAL)
        self.lsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_folder = wx.Button(self.panel, label='Load Candidate Faces')
        self.lsizer.Add(self.btn_folder, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseFolder, self.btn_folder)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.grid = base.MyGridStaticBitmap(self.panel, 0, 4, 0, 0)
        self.lsizer.Add(self.grid, 0, flag, 5)

        self.vhsizer.Add(self.lsizer, 1, wx.EXPAND)
        self.vhsizer.AddSpacer(90)

        self.rsizer = wx.BoxSizer(wx.VERTICAL)
        self.rsizer.SetMinSize((util.MAX_IMAGE_SIZE, -1))

        flag = wx.EXPAND | wx.ALIGN_CENTER | wx.ALL
        self.btn_file = wx.Button(self.panel, label='Open Query Face')
        self.rsizer.Add(self.btn_file, 0, flag, 5)
        self.Bind(wx.EVT_BUTTON, self.OnChooseImage, self.btn_file)

        flag = wx.ALIGN_CENTER | wx.ALL
        self.bitmap = base.MyStaticBitmap(self.panel)
        self.rsizer.Add(self.bitmap, 0, flag, 5)

        self.result = base.FindSimilarsResult(self.panel)
        self.rsizer.Add(self.result, 0, wx.EXPAND)

        self.vhsizer.Add(self.rsizer, 1, wx.EXPAND)

        self.hvsizer.Add(self.vhsizer)

        self.hsizer.Add(self.hvsizer)
        self.hsizer.AddStretchSpacer()
        self.hsizer.Layout()

        self.panel.SetSizer(self.hsizer)
        self.panel.Layout()
        self.panel.SetupScrolling(scroll_x=False)

        self.vsizer.Add(self.panel, 3, wx.EXPAND)

        self.log = base.MyLog(self)
        self.vsizer.Add(self.log, 1, wx.EXPAND)

        self.SetSizerAndFit(self.vsizer)

        self.btn_file.Disable()