Skip to content

Commit

Permalink
Suggest largest when choose ap50 best conf
Browse files Browse the repository at this point in the history
  • Loading branch information
shensheng272 authored Sep 20, 2022
1 parent f6eb2b2 commit 5ac5344
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yolov6/core/evaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def predict_model(self, model, dataloader, task):

from yolov6.utils.metrics import ap_per_class
p, r, ap, f1, ap_class = ap_per_class(*stats, plot=self.plot_curve, save_dir=self.save_dir, names=model.names)
AP50_F1_max_idx = f1.mean(0).argmax()
AP50_F1_max_idx = len(f1.mean(0)) - f1.mean(0)[::-1].argmax() -1
LOGGER.info(f"IOU 50 best mF1 thershold near {AP50_F1_max_idx/1000.0}.")
ap50, ap = ap[:, 0], ap.mean(1) # [email protected], [email protected]:0.95
mp, mr, map50, map = p[:, AP50_F1_max_idx].mean(), r[:, AP50_F1_max_idx].mean(), ap50.mean(), ap.mean()
Expand Down

0 comments on commit 5ac5344

Please sign in to comment.