1313
1414class MyPanel (wx .Panel ):
1515 """Base Panel."""
16+
1617 def __init__ (self , parent ):
1718 super (MyPanel , self ).__init__ (parent )
1819 colour_window = wx .SystemSettings .GetColour (wx .SYS_COLOUR_WINDOW )
@@ -21,6 +22,7 @@ def __init__(self, parent):
2122
2223class MyStaticBitmap (MyPanel ):
2324 """Base StaticBitmap."""
25+
2426 def __init__ (self , parent , bitmap = wx .NullBitmap , size = util .MAX_IMAGE_SIZE ):
2527 super (MyStaticBitmap , self ).__init__ (parent )
2628 self .bmp = bitmap
@@ -49,7 +51,13 @@ def set_path(self, path):
4951
5052class MyGridStaticBitmap (wx .Panel ):
5153 """Base Grid StaticBitmap."""
52- def __init__ (self , parent , rows = 1 , cols = 0 , vgap = 0 , hgap = 0 ,
54+
55+ def __init__ (self ,
56+ parent ,
57+ rows = 1 ,
58+ cols = 0 ,
59+ vgap = 0 ,
60+ hgap = 0 ,
5361 size = util .MAX_THUMBNAIL_SIZE ):
5462 super (MyGridStaticBitmap , self ).__init__ (parent )
5563 self .sizer = wx .GridSizer (rows , cols , vgap , hgap )
@@ -78,6 +86,7 @@ def set_faces(self, faces):
7886
7987class WrapCaptionFaceList (wx .WrapSizer ):
8088 """Wrap face list with caption under the face."""
89+
8190 def __init__ (self , parent , confidence_faces , size = util .MAX_THUMBNAIL_SIZE ):
8291 super (WrapCaptionFaceList , self ).__init__ ()
8392 for face , confidence in confidence_faces :
@@ -96,6 +105,7 @@ def __init__(self, parent, confidence_faces, size=util.MAX_THUMBNAIL_SIZE):
96105
97106class FindSimilarsResult (wx .Panel ):
98107 """The view for Find Similar result."""
108+
99109 def __init__ (self , parent ):
100110 super (FindSimilarsResult , self ).__init__ (parent )
101111 self .sizer = wx .BoxSizer (wx .VERTICAL )
@@ -104,7 +114,8 @@ def set_data(self, faces, res_tot, size=util.MAX_THUMBNAIL_SIZE):
104114 """Set the data."""
105115 self .sizer .Clear (True )
106116 static_text_title = wx .StaticText (
107- self , label = 'Find {} Similar Candidate Faces Results:' .format (
117+ self ,
118+ label = 'Find {} Similar Candidate Faces Results:' .format (
108119 len (faces )))
109120 self .sizer .Add (static_text_title , 0 , wx .EXPAND )
110121
@@ -133,6 +144,7 @@ def set_data(self, faces, res_tot, size=util.MAX_THUMBNAIL_SIZE):
133144
134145class WrapFaceList (wx .Panel ):
135146 """Base wrap face list."""
147+
136148 def __init__ (self , parent , faces , size = util .MAX_THUMBNAIL_SIZE ):
137149 super (WrapFaceList , self ).__init__ (parent )
138150 self .sizer = wx .WrapSizer ()
@@ -146,6 +158,7 @@ def __init__(self, parent, faces, size=util.MAX_THUMBNAIL_SIZE):
146158
147159class CaptionWrapFaceList (wx .Panel ):
148160 """Wrap face list with a caption."""
161+
149162 def __init__ (self , parent ):
150163 super (CaptionWrapFaceList , self ).__init__ (parent )
151164 self .sizer = wx .BoxSizer (wx .VERTICAL )
@@ -165,6 +178,7 @@ def set_data(self, caption_faces_list, size=util.MAX_THUMBNAIL_SIZE):
165178
166179class GroupResult (wx .Panel ):
167180 """The view for Group result."""
181+
168182 def __init__ (self , parent ):
169183 super (GroupResult , self ).__init__ (parent )
170184 self .sizer = wx .BoxSizer (wx .VERTICAL )
@@ -195,6 +209,7 @@ def set_data(self, faces, res, size=util.MAX_THUMBNAIL_SIZE):
195209
196210class MyLog (wx .TextCtrl ):
197211 """The window for each scenario."""
212+
198213 def __init__ (self , parent ):
199214 style = wx .TE_MULTILINE | wx .TE_READONLY
200215 super (MyLog , self ).__init__ (parent , style = style )
@@ -210,6 +225,7 @@ def log(self, msg):
210225
211226class MyFaceList (wx .VListBox ):
212227 """Face List."""
228+
213229 def __init__ (self , parent , faces = [], ** kwargs ):
214230 super (MyFaceList , self ).__init__ (parent , ** kwargs )
215231 self .SetItems (faces )
@@ -230,17 +246,10 @@ def OnDrawItem(self, dc, rect, index):
230246 textx = rect .x + 2 + face .bmp .GetWidth () + 2
231247 label_rect = wx .Rect (textx , rect .y , rect .width - textx , rect .height )
232248 label = util .LABEL_FACE .format (
233- face .attr .gender ,
234- face .attr .age ,
235- face .attr .hair ,
236- face .attr .facial_hair ,
237- face .attr .makeup ,
238- face .attr .emotion ,
239- face .attr .occlusion ,
240- face .attr .exposure ,
241- face .attr .head_pose ,
242- face .attr .accessories
243- )
249+ face .attr .gender , face .attr .age , face .attr .hair ,
250+ face .attr .facial_hair , face .attr .makeup , face .attr .emotion ,
251+ face .attr .occlusion , face .attr .exposure , face .attr .head_pose ,
252+ face .attr .accessories )
244253 dc .DrawLabel (label , label_rect , wx .ALIGN_LEFT | wx .ALIGN_TOP )
245254
246255 def SetItems (self , faces ):
0 commit comments