@@ -61,7 +61,6 @@ def init_model(self, model, weights, task):
6161
6262 def init_data (self , dataloader , task ):
6363 '''Initialize dataloader.
64-
6564 Returns a dataloader for task val or speed.
6665 '''
6766 self .is_coco = isinstance (self .data .get ('val' ), str ) and 'coco' in self .data ['val' ] # COCO dataset
@@ -104,10 +103,10 @@ def predict_model(self, model, dataloader, task):
104103 return pred_results
105104
106105 def eval_model (self , pred_results , model , dataloader , task ):
107- '''Evaluate current model
108- For task speed, this function only evaluates the speed of model and output inference time.
109- For task val, this function evalutates the speed and also evaluates mAP by pycocotools, and then
110- returns inference time and mAP value.
106+ '''Evaluate models
107+ For task speed, this function only evaluates the speed of model and outputs inference time.
108+ For task val, this function evalutates the speed and mAP by pycocotools, and returns
109+ inference time and mAP value.
111110 '''
112111 LOGGER .info (f'\n Evaluating speed.' )
113112 self .eval_speed (task )
@@ -145,7 +144,7 @@ def eval_model(self, pred_results, model, dataloader, task):
145144 return (0.0 , 0.0 )
146145
147146 def eval_speed (self , task ):
148- '''Evaluate the speed of model .'''
147+ '''Evaluate model inference speed .'''
149148 if task != 'train' :
150149 n_samples = self .speed_result [0 ].item ()
151150 pre_time , inf_time , nms_time = 1000 * self .speed_result [1 :].cpu ().numpy () / n_samples
@@ -215,7 +214,7 @@ def check_task(task):
215214
216215 @staticmethod
217216 def reload_thres (conf_thres , iou_thres , task ):
218- '''Sets conf and iou thres for task val/speed'''
217+ '''Sets conf and iou threshold for task val/speed'''
219218 if task != 'train' :
220219 if task == 'val' :
221220 conf_thres = 0.001
0 commit comments