@@ -110,9 +110,9 @@ def compute_AP(self, component="ivt", ignore_null=False):
110110 targets = self .extract (self .targets , component )
111111 predicts = self .extract (self .predictions , component )
112112 else :
113- sys .exit (f "Function filtering { component } not yet supported!" )
113+ sys .exit ("Function filtering {} not yet supported!" . format ( component ) )
114114 with warnings .catch_warnings ():
115- warnings .filterwarnings (action = 'ignore' , message = '[info] triplet classes not represented in this test sample will be reported as nan values.' )
115+ warnings .filterwarnings (action = 'ignore' ) # , message='[info] triplet classes not represented in this test sample will be reported as nan values.')
116116 classwise = average_precision_score (targets , predicts , average = None )
117117 if (ignore_null and component == "ivt" ): classwise = classwise [:- 6 ]
118118 mean = np .nanmean (classwise )
@@ -143,9 +143,9 @@ def compute_global_AP(self, component="ivt", ignore_null=False):
143143 targets = self .extract (targets , component )
144144 predicts = self .extract (predicts , component )
145145 else :
146- sys .exit (f "Function filtering { component } not yet supported!" )
146+ sys .exit ("Function filtering {} not yet supported!" . format ( component ) )
147147 with warnings .catch_warnings ():
148- warnings .filterwarnings (action = 'ignore' , message = '[info] triplet classes not represented in this test sample will be reported as nan values.' )
148+ warnings .filterwarnings (action = 'ignore' ) # , message='[info] triplet classes not represented in this test sample will be reported as nan values.')
149149 classwise = average_precision_score (targets , predicts , average = None )
150150 if (ignore_null and component == "ivt" ): classwise = classwise [:- 6 ]
151151 mean = np .nanmean (classwise )
@@ -178,7 +178,7 @@ def compute_video_AP(self, component="ivt", ignore_null=False):
178178 targets = self .extract (targets , component )
179179 predicts = self .extract (predicts , component )
180180 else :
181- sys .exit (f "Function filtering { component } not yet supported!" )
181+ sys .exit ("Function filtering {} not yet supported!" . format ( component ) )
182182 classwise = average_precision_score (targets , predicts , average = None )
183183 video_log .append ( classwise .reshape ([1 ,- 1 ]) )
184184 video_log = np .concatenate (video_log , axis = 0 )
@@ -214,7 +214,7 @@ def topK(self, k=5, component="ivt"):
214214 targets = self .extract (targets , component )
215215 predicts = self .extract (predicts , component )
216216 else :
217- sys .exit (f "Function filtering { component } not supported yet!" )
217+ sys .exit ("Function filtering {} not supported yet!" . format ( component ) )
218218 correct = 0.0
219219 total = 0
220220 for gt , pd in zip (targets , predicts ):
@@ -248,7 +248,7 @@ def topClass(self, k=10, component="ivt"):
248248 targets = self .extract (targets , component )
249249 predicts = self .extract (predicts , component )
250250 else :
251- sys .exit (f "Function filtering { component } not supported yet!" )
251+ sys .exit ("Function filtering {} not supported yet!" . format ( component ) )
252252 classwise = average_precision_score (targets , predicts , average = None )
253253 pd_idx = (- classwise ).argsort ()[:k ]
254254 output = {x :classwise [x ] for x in pd_idx }
0 commit comments