@@ -58,7 +58,9 @@ def retrieveData_and_computeEpLines(self, img, imNum):
5858 if self .sourceCam is None :
5959 sourceCam = [
6060 otherCam for otherCam in cams if cam not in otherCam
61- ][0 ] #WHY?
61+ ][
62+ 0
63+ ] # WHY?
6264 else :
6365 sourceCam = self .sourceCam
6466
@@ -80,11 +82,13 @@ def retrieveData_and_computeEpLines(self, img, imNum):
8082
8183 try :
8284 dataFrame = pd .read_hdf (
83- os .path .join (sourceCam_path , "CollectedData_" + scorer + ".h5" ),
85+ os .path .join (sourceCam_path , "CollectedData_" + scorer + ".h5" )
8486 )
8587 dataFrame .sort_index (inplace = True )
8688 except IOError :
87- print ("source camera images have not yet been labeled, or you have opened this folder in the wrong mode!" )
89+ print (
90+ "source camera images have not yet been labeled, or you have opened this folder in the wrong mode!"
91+ )
8892 return None , None , None
8993
9094 # Find offset terms for drawing epipolar Lines
@@ -241,7 +245,7 @@ def clearBoxer(self):
241245class MainFrame (BaseFrame ):
242246 def __init__ (self , parent , config , imtypes , config3d , sourceCam ):
243247 super (MainFrame , self ).__init__ (
244- "DeepLabCut2.0 - Labeling ToolBox" , parent , imtypes ,
248+ "DeepLabCut2.0 - Labeling ToolBox" , parent , imtypes
245249 )
246250
247251 self .statusbar .SetStatusText (
@@ -370,9 +374,7 @@ def OnKeyPressed(self, event=None):
370374 inv = self .axes .transData .inverted ()
371375 pos_rel = list (inv .transform (pos_abs ))
372376 y1 , y2 = self .axes .get_ylim ()
373- pos_rel [1 ] = (
374- y1 - pos_rel [1 ] + y2
375- ) # Recall y-axis is inverted
377+ pos_rel [1 ] = y1 - pos_rel [1 ] + y2 # Recall y-axis is inverted
376378 i = np .nanargmin (
377379 [self .calc_distance (* dp .point .center , * pos_rel ) for dp in self .drs ]
378380 )
@@ -619,7 +621,7 @@ def browseDir(self, event):
619621 # Reading the existing dataset,if already present
620622 try :
621623 self .dataFrame = pd .read_hdf (
622- os .path .join (self .dir , "CollectedData_" + self .scorer + ".h5" ),
624+ os .path .join (self .dir , "CollectedData_" + self .scorer + ".h5" )
623625 )
624626 self .dataFrame .sort_index (inplace = True )
625627 self .prev .Enable (True )
@@ -892,9 +894,7 @@ def plot(self, img):
892894 )
893895 ]
894896 self .axes .add_patch (circle [0 ])
895- self .dr = auxfun_drag .DraggablePoint (
896- circle [0 ], self .bodyparts [bpindex ]
897- )
897+ self .dr = auxfun_drag .DraggablePoint (circle [0 ], self .bodyparts [bpindex ])
898898 self .dr .connect ()
899899 self .dr .coords = MainFrame .getLabels (self , self .iter )[bpindex ]
900900 self .drs .append (self .dr )
@@ -952,7 +952,6 @@ def onChecked(self, event):
952952 self .slider .Enable (False )
953953
954954
955-
956955def show (config , config3d , sourceCam , imtypes = ["*.png" ]):
957956 app = wx .App ()
958957 frame = MainFrame (None , config , imtypes , config3d , sourceCam ).Show ()
0 commit comments